Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
The += operator is known as an assignment operator. It adds the value on the right-hand side of the operator to the variable on the left-hand side and assigns the result back to that variable.
Related terms
Arithmetic operators: Arithmetic operators are used for mathematical calculations in programming, such as addition, subtraction, multiplication, division, etc.
Compound assignment operators: Compound assignment operators combine an arithmetic operation with an assignment operation. Examples include +=, -=, *=, /=.
Increment/Decrement operators: Increment (++) and decrement (--) operators are used to increase or decrease a variable's value by 1 respectively. They can be combined with other arithmetic operations using compound assignment operators like += or -=.