Inactive Tutor answered 04/13/21
using namespace std;
#include <iostream>
#include <math.h>
int main()
{
double x;
cout << " Please input the decimal number :>";
cin >> x;
cout << x << " is between " << floor(x) << " and " << ceil(x) << endl;
}
Kat H.
asked 04/12/21Read in a decimal value. Print out the two integers it is between, smaller value first, with exactly one space in between them. If it is an integer value already, your program should print out the integer twice.
Hint: ceiling and floor functions are the tools you need.
Code:
#include <iostream>
Don't forget math library!!!
using namespace std;
int main()
{
//YOUR_CODE
}
Inactive Tutor answered 04/13/21
using namespace std;
#include <iostream>
#include <math.h>
int main()
{
double x;
cout << " Please input the decimal number :>";
cin >> x;
cout << x << " is between " << floor(x) << " and " << ceil(x) << endl;
}
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.