Write a program to implement round function in c

Write a program to implement round function in c. The round( ) method in C returns the integer value that is closest to the float/double/long double input supplied to it.It returns an integer value less than the parameter if the decimal value is between “1 and.5′′. It returns the integer value bigger than the parameter if the decimal value is between “.6 and.9′′.In C, the round( ) function is supported by the “math.h” header file. In C, the round( ) function has the following syntax.

#include <stdio.h>
#include <math.h>
int main()
{
float i=2.4, j=3.6;
printf("round of %f is %f\n", i, round(i));
printf("round of %f is %f\n", j, round(j));
return 0;
}

Output:

round of 2.400000 is 2.000000
round of 3.600000 is 4.000000