floor (math function) in C.

 

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

original number 123.54
number rounded down 123.00

Related Post

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.