English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
C Library Function double fmod(double x, double y) returns x divided by y the remainder.
Below is the declaration of the fmod() function.
double fmod(double x, double y)
x -- representing the numerator as a floating-point value.
y -- representing the denominator as a floating-point value.
This function returns the remainder of x/the remainder of y.
The following example demonstrates the usage of the fmod() function.
#include <stdio.h> #include <math.h> int main() { float a, b; int c; a = 6.25; b = 5.1; c = 4; printf("%f"} / %d's remainder is %lf\n", a, c, fmod(a, c)); printf("%f"} / printf("%f The remainder is %lf\n", a, b, fmod(a, b)); return(0); }
Let's compile and run the above program, which will produce the following result:
6.250000 / 4 The remainder is 2.250000 6.250000 / 5.10The remainder of 0000 is 1.150000