Which one of the following is example of compound assignment operator in C language?
-
a* = 5;
-
a=a+5;
-
a=a*5;
-
a<5;
-
a&&5
A
Correct answer
Explanation
Actual calculation of this code is a=a*5; but to shorten the code and make the program execution faster compound operator is used. The compound assignment operators consist of a binary operator and the simple assignment operator. They perform the operation of the binary operator on both operands and store the result of that operation into the left operand, which must be a modifiable lvalue.