Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // cpp program to find the floor and ceiling of a given floating point value
- #include <iostream>
- using namespace std;
- int main() {
- cout << "Given floating point value: ";
- float value; cin >> value;
- cout << "\nFloor: " << int(value) << endl;
- if (value == int(value))
- cout << "\nCeiling: " << int(value) << endl << endl;
- else cout << "\nCeiling: " << int(value) + 1 << endl << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement