|
|
|||||
|
Get the Ebook
C Tutorial
Source Code
Function Reference
|
fmod()Prototype: double fmod(double numone, double numtwo);Header File: math.h (C) or cmath (C++) Explanation: This function is the same as the modulus operator. It returns the remainder of the division numone/numtwo. I include it to avoid it being confused with modf, a previous function of the day. Example:
//Example will output remainder of 12/5 (2)
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
cout<<"The remainder of 12/5: "<<fmod(12/5);
}
Other Functions
Want to become a C++ programmer? The Cprogramming.com ebook, Jumping into C++, will walk you through it, step-by-step. Get Jumping into C++ today!
Popular pages
Custom Search
|
||||