Site icon T4Tutorials.com

Compound Operations Program in C++(C Plus Plus)

Compound Operations Program in C++(C Plus Plus)

In this latest tutorial, we will cover the following topics;

  1. Compound Operations Program in C++(C Plus Plus)
#include <iostream>
using namespace std;
int main()
{
int a,b;
cout<<"Enter Value of a =";
cin>>a;
cout<<"Enter Value of b =";
cin>>b;
a+=b;
cout<<"Value of a after a+ is "<<a<<endl;
a-=b;
cout<<"Value of a after a- is "<<a<<endl;
a*=b;
cout<<"Value of a after a* is "<<a<<endl;
a/=b;
cout<<"value of a after a/ is "<<a<<endl;
a%=b;
cout<<"Value of after a% is "<<a;}

Output:

Compound Operations Program in C++(C Plus Plus)
Compound Operations Program in C++(C Plus Plus)
Exit mobile version