Showing posts with label A.floor function. Show all posts
Showing posts with label A.floor function. Show all posts

floor() function

Floor function is used to get nearest integer less than equal to the entered number or number stored in variable.This function is included in math.h header file to access this function we have to add "#include<math.h>".Let us see how to use this function by an simple example.

Example:
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
         float b=10.5,c=-9.34;
         clrscr();
         printf("The floor of b is %f",floor(b));
         printf("\nThe floor of c is %f",floor(c));
         getch();
}