Compound Assignment Operators

Compound assignment operators abbreviate assignment expressions.

Example:

c = c + 3;

can be written with the addition compound assignment operator, +=, as

c += 3;

The += operator adds the value of the expression on its right to the value of the variable on its left and stores the result in the variable on the left of the operator.