c 2b 2b round number down

Solutions on MaxInterview for c 2b 2b round number down by the best coders in the world

showing results for - "c 2b 2b round number down"
Mehdi
23 Jan 2020
1#include <iostream>
2#include <cmath>
3
4using namespace std;
5
6int main()
7{
8	double num1 = 4.8;
9  	double num2 = 4.3;
10  	cout << floor(num1) << endl; // --> 4
11  	cout << floor(num2) << endl; // --> 4
12}
Erica
19 Jan 2020
1#include <iostream>
2#include <cmath>
3
4using namespace std;
5
6int main()
7{
8	double num1 = 4.8;
9  	double num2 = 4.3;
10  	cout << ceil(num1) << endl; // --> 5
11  	cout << ceil(num2) << endl; // --> 5
12}