result += a +b in c++ meaning
result += a + b;
a + b
: Adds the values of variablesa
andb
.result += a + b
: Adds the result of step 1 to the current value of the variableresult
and assigns the sum back toresult
.
result += a + b;
a + b
: Adds the values of variables a
and b
.result += a + b
: Adds the result of step 1 to the current value of the variable result
and assigns the sum back to result
.