C++ program to demonstrate following operators: double equal(==), not equal(!=), less/greater than, less/greater than equal to, plus/minus equal to(+=) (-=), multiply/dived equal to(*=) (/=), modulus equal to(%=)

Code

#include<iostream>
using namespace std;
int main()
{
       int a, b;
       cout<<"enter first number : ";
       cin>>a;
       cout<<"enter a 2nd number : ";
       cin>>b;
       cout<<"(a==b)="<<(a==b)<<endl;
       cout<<"(a!=b)"<<(a!=b)<<endl;
       cout<<"(a<b)="<<(a<b)<<endl;
       cout<<"(a>b)="<<(a>b)<<endl;
       cout<<"(a<=b)="<<(a<=b)<<endl;
       cout<<"(a>=b)="<<(a>=b)<<endl;
       cout<<"(a+=b)="<<(a+=b)<<endl;
       cout<<"(a-=b)="<<(a-=b)<<endl;
       cout<<"(a/=b)="<<(a/=b)<<endl;
       cout<<"(a%=b)="<<(a%=b)<<endl;
       cout<<"(a*=b)="<<(a*=b)<<endl;
       system("pause");
       return 0;
}



Output



Comments