Thursday, May 12, 2016

Ceil and Floor Function




Ceil function is used to round up a number i.e. it returns the smallest number which is greater than argument passed to it.

Floor function is used to round a number i.e. it returns the largest number which is smaller than argument passed to it.



#include<stdio.h>
#include<math.h>

int main()
{
    printf("\n Result : %f" , ceil(1.44) );
    printf("\n Result : %f" , ceil(1.66) );

    printf("\n Result : %f" , floor(1.44) );
    printf("\n Result : %f" , floor(1.66) );

    return 0;
}



Share this

2 Responses to "Ceil and Floor Function"