Remainder

Anyone can help me for this,How to get the remainder?


#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
double a,b,sum,difference,quotient,product,remainder;
cout<<"Enter 1st Number:";
cin>>a;
cout<<"Enter 2st Number:";
cin>>b;
sum=a+b;
difference=a-b;
quotient=a/b;
product=a*b;
Remainder=????????????????(What formula that i can input here?)

getch();
return 0;
}


Thank you,Hope you can help me guys,,,
Thank you,,,But i need the value,,Example:5/2=2 remainder 1, Do you have an Idea about this?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>

int main()
{
    int dividend = 5 ; // std::cin >> dividend ;
    int divisor = 2 ; // std::cin >> divisor ;
    
    if( divisor != 0 ) 
    {
        const int remainder = dividend % divisor ;

        std::cout << "remainder after division of " << dividend << " by " << divisor 
                  << " is " << remainder << '\n' ;
    }
}

http://coliru.stacked-crooked.com/a/d960315f80e43dad
Thank You very much!!! :)
Topic archived. No new replies allowed.