+ 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));
+ 1
In
printf("%d", ceil (c));
%d is not for print a float variable.
+ 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?
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.