Answer:
Following are the program in the C++ Programming Language.
//header file
#include <iostream>
//header file for floor function
#include<math.h>
//using namespace
using namespace std;
//define main function
int main() {
//set and initialize float type variable and value
float a=12.3, c=1.45, d=165.345;
//initialize it in other variable
float x=a;
//set float variable to store floor value
float y=floor(x+5);
//display output with message
cout<<"before "<<x<<" and after the floor "<<y<<endl;
//set float variable to store floor value
y=floor(c+5);
//display output with message
cout<<"before "<<c<<" and after the floor "<<y<<endl;
//set float variable to store floor value
y=floor(d+5);
//display output with message
cout<<"before "<<d<<" and after the floor "<<y;
}
Output:
before 12.3 and after the floor 17
before 1.45 and after the floor 6
before 165.345 and after the floor 170
Explanation:
Here, we define the "main()" function and inside the main function.