+= Assignment Operator

The += assignment operator adds a given numeric expression and assigns it to the given variable.

Syntax

variable += num.exp

Example(s)

Adds 1 to the variable, x.

x += 1

The statement below:

total += tax

is equivalent of the statement:

total = total + tax

See Also

* Arithmetic Operator, *= Assignment Operator, - Arithmetic Operator, -= Assignment Operator, /= Assignment Operator, := Assignment Operator, Arithmetic Expressions, Arithmetic Operators, Assignment, Numeric Expressions, Precedence, precision Statement, Relational Operators, sum() Function, \= Assignment Operator