Question #cac52

1 Answer
Mar 15, 2017

#"sum + = 47"#

Explanation:

As you know, the C++ statement

#"sum" = "sum" + 47#

is equivalent to

#"the new value of sum" = "the old value of sum" + 47#

In other words, the variable that is added to the left of the #=# sign is being assigned the value that is added to the right of the #=# sign.

In this case, for every iteration, the value of the variable #"sum"# increases by #47#.

Now, you can write this using a single arithmetic assignment operator like this

#"sum + = 47"#

This is equivalent to saying that with every iteration, the variable that is added to the left increase by the value added to the right of the #=# sign.

In this notation, the fact that the value assigned to the variable is increasing by #47# is being added to the left of the #=# sign.