Question discussion

What does the += operator do in C?

359041Medium DSSSB TGT Computer Science 0 replies 0 views
0
What does the += operator do in C?
  • AAdds the right operand to the left operand and assigns the result to the left operand.
  • BIt is used to concatenate two strings.
  • CIt is an invalid operator.
  • DAssigns the value of the right operand to the left operand.
Correct answer: A

Explanation

a += b is shorthand for a = a + b, which adds the right operand to the left operand and assigns the result to it.

Discussion 0

Nobody has replied yet. Start the discussion!