Ceil function is used to get nearest integer greater than or equal value to given number.it is included in math.h header file.so we have to add "#include<math.h>" to use this function.Let us see how to use ceil function.
Example:
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
float a=1.2,b=9.47;
clrscr();
printf("ceil of the given number a is %f",ceil(a));
printf("\nCeil of the given number b %f",ceil(b));
getch();
}
Example:
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
float a=1.2,b=9.47;
clrscr();
printf("ceil of the given number a is %f",ceil(a));
printf("\nCeil of the given number b %f",ceil(b));
getch();
}