Home » C Programming » Assignment Operators in C Programming

Assignment Operators in C Programming

In a C language there are following assignment operators  −

Operator Description Example
= assignment operator (it assigns values of right side operands to left side operand ) a=5
+= Add assignment operator a+=5
-= Subtract assignment operator a-=5
*= Multiply  assignment operator a*=5
/= Divide assignment operator a/=5
%= Modulus assignment operator a%=5
<<= Left shift assignment operator a<<=5
>>= Right shift assignment operator a>>=5
&= Bitwise AND assignment operator a&=5
^= Bitwise exclusive OR assignment operator a^=5
|= Bitwise inclusive OR assignment operator a|=5

EXAMPLE: Use of assignment operators with arithmetic operators

Output

EXAMPLE: Use of assignment operators with bitwise operators

Output

Please follow and like us:
error