♦ remainder() - cmath
♣ Example1: remainder()
Input:
xxxxxxxxxx
1
#include <iostream>
2
#include <cmath>
3
4
using namespace std;
5
6
int main()
7
{
8
double num1=4;
9
double result1=remainder(num1,3);
10
cout<<"Result1 is: "<<result1<<"\n\n";
11
12
13
double num2=8;
14
double result2=remainder(num2,2);
15
cout<<"Result2 is: "<<result2<<"\n\n";
16
17
18
double num3=6;
19
double result3=remainder(num3,10);
20
cout<<"Result3 is: "<<result3<<"\n\n";
21
22
23
return 0;
24
}
Output:
1
1