You are here : cpp0fmod

fmod() - 0

The C library function double fmod(double x, double y) returns the remainder of x divided by y.


Syntax

double fmod(double x, double y)


Example

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

int main ()
{
   float a, b;
   int c;
   a = 9.2;
   b = 3.7;
   c = 2;
   printf("Remainder of %f / %d is %lf\n", a, c, fmod(a,c));
   printf("Remainder of %f / %f is %lf\n", a, b, fmod(a,b));
   
   return(0);
}


Output / Return Value

Remainder of 9.200000 / 2 is 1.200000
Remainder of 9.200000 / 3.700000 is 1.800000


Limitations


Alternatives / See Also


Reference