Assignment operators supported by C language are as follows.
| Operator | Description | Example |
|---|---|---|
| = | assigns values from right side operands to left side operand | a=b |
| += | adds right operand to the left operand and assign the result to left | a+=b is same as a=a+b |
| -= | subtracts right operand from the left operand and assign the result to left operand | a-=b is same as a=a-b |
| *= | mutiply left operand with the right operand and assign the result to left operand | a*=b is same as a=a*b |
| /= | divides left operand with the right operand and assign the result to left operand | a/=b is same as a=a/b |
| %= | calculate modulus using two operands and assign the result to left operand | a%=b is same as a=a%b |
Ask Question