fmod() function

The fmod() function returns the floating-point remainder of x/y. If the denominator y is zero, fmod() returns NaN (Not a Number).

Example:

Input:  x=7.5 ,  y =2.4
Output: 0.3

Approach

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    double x = 7.5y = 2.4;

    cout << fmod(xy);

    return 0;
}


No comments:

Post a Comment