+ 3
Laukesh singh The C library function double ceil(double x) returns the smallest integer value greater than or equal to x. Declaration: double ceil(double x) If you want an integer so explicit conversion will be needed as follows: printf("%d", (int)ceil(c));
9th Oct 2022, 7:36 PM
JaScript
JaScript - avatar
+ 1
In printf("%d", ceil (c)); %d is not for print a float variable.
9th Oct 2022, 3:00 PM
JaScript
JaScript - avatar
+ 1
Laukesh singh I ran the code, but the problems didn't occur. I gave as input: 25 4 And the output was: 6.0000... Exactly like it should. Can you give some examples of input/output pairs which show the problem?
10th Oct 2022, 9:17 AM
Emerson Prado
Emerson Prado - avatar
0
Laukesh singh Put your code in Code Playground, save as public and add a link to it (with "+" button) in the question description. This way, we can test it.
10th Oct 2022, 12:46 AM
Emerson Prado
Emerson Prado - avatar