remquo() in C++


The function remquo() is used to calculate the floating point remainder of numerator or denominator and stores the quotient to the passed pointer. It returns Nan(Not a number) when denominator is zero.

Here is the syntax of remquo() in C++ language,

float remquo(float var1, float var2, int* var3);

Here,

  • var1  − The variable which stores the value of numerator.

  • var2  − The variable which stores the value of denominator.

  • var3  − The pointer variable which stores the quotient.

Here is an example of remquo() in C++ language,

Example

 Live Demo

#include <iostream>
#include <cmath>

using namespace std;

int main() {
   float x = 28.8;
   float y = 3.5;
   int z;

   float res = remquo(x, y, &z);
   cout << "The value : " << res;
   return 0;
}

Output

Here is the output

The value : 0.799999

Updated on: 25-Jun-2020

35 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements