+= 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