ceil (math function) in C

 

01  #include <math.h>
02 #include <stdio.h>
03
04 int main()
05 {
06 double num = 123.54;
07 double up_value;
08
09 up_value = ceil(num);
10
11 printf("original number %5.2lfn", num);
12 printf("number rounded up %5.2lfn", up_value);
13
14 return 0;
15 }
 
 
OUTPUT :

original number 123.54
number rounded up 124.00

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *