#include<iostream>usingnamespacestd;intmain(){inta=0,b=1;cout<<"———————————————————————————————————————————";cout<<"\nProgram to perform the assignment operations ";cout<<"\n———————————————————————————————————————————";cout<<"\nValue of a | "<<a;cout<<"\nValue of b | "<<b;cout<<"\nValue of "<<a<<" += "<<b<<" | "<<(a+=b);cout<<"\nValue of "<<a<<" -= "<<b<<" | "<<(a-=b);cout<<"\nValue of "<<a<<" *= "<<b<<" | "<<(a*=b);cout<<"\nValue of "<<a<<" /= "<<b<<" | "<<(a/=b);cout<<"\nValue of "<<a<<" %= "<<b<<" | "<<(a%=b);cout<<"\nValue of "<<a<<" ^= "<<b<<" | "<<(a^=b);cout<<"\nValue of "<<a<<" |= "<<b<<" | "<<(a|=b);cout<<"\nValue of "<<a<<" &= "<<b<<" | "<<(a&=b);cout<<"\n———————————————————————————————————————————\n";return0;}
Output
kodingwindow@kw:~$ g++ kw.cpp kodingwindow@kw:~$ ./a.out
———————————————————————————————————————————
Program to perform the assignment operations
———————————————————————————————————————————
Value of a | 0
Value of b | 1
Value of 0 += 1 | 1
Value of 1 -= 1 | 0
Value of 0 *= 1 | 0
Value of 0 /= 1 | 0
Value of 0 %= 1 | 0
Value of 0 ^= 1 | 1
Value of 1 |= 1 | 1
Value of 1 &= 1 | 1
———————————————————————————————————————————
kodingwindow@kw:~$
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.