using namespace std;
float v, n;
cin >> v;
cin >> n;
k = (v * 12)/ n;
cout << ceil((int)k);
For some reason ceil doesn't work... Could someone help?
You're truncating the number before even giving it to ceil.
Remove the cast to int and it should work.
Last edited on
Why have you made k an integer on line 11? take out (int) and see if you get the same problem
It worked :) Thanks
Topic archived. No new replies allowed.