+ 1

Can someone help me, to understanding what missing in this code

Solve problem about ceilling https://code.sololearn.com/cQK15MSUPoWI/?ref=app

16th Jan 2020, 4:38 AM
Guntur Darmawan
Guntur Darmawan - avatar
3 Respuestas
+ 1
cout << ceil(x) << endl; no need for setprecision but you have to uncomment <cmath>
16th Jan 2020, 6:17 AM
Bahhaⵣ
Bahhaⵣ - avatar
+ 2
Guntur Darmawan You have not commented your above declared main function and header files correctly. Also you have declared the variable and logic multiple times which giving multiple declaration of same variables as an error Try this way. #include <iostream> //#include <cmath> #include <iomanip> using namespace std; int main(){ float x, home; cin >> home; //your code goes here x =(2 / home)*100; cout <<setprecision(2)<< x << endl; return 0; }
16th Jan 2020, 6:10 AM
DishaAhuja
DishaAhuja - avatar
+ 1
Thanks thats is work:)
16th Jan 2020, 6:20 AM
Guntur Darmawan
Guntur Darmawan - avatar