fmod(x,y) function in C, what is do?
It calculates x modulo y i.e., the remainder of x/y.
This function is the same as the modulus operator, but fmod() performs floating point divisions.
Example:
#include <stdio.h>
#include <math.h>
void main ()
{
printf ("fmod of 16.9 and 13.2 is %lf", fmod (16.9,13.2) );
getch 0;
}
Output:
1.280303
Explanation:
First two lines are header files which is included to use input/output function i.e., printf
and mathematical function fmod.
fmod is the function which is used to find out the remainder after division of the
two floating point numbers.
No comments:
Post a Comment