Another Addition Operator Adding numbers to variables is such a common task in programming that there is a special operator for it. The += operator is short hand for incrementing a variable by a number. For example, instead of x = x + 10;, you can write x += 10;. They both do the same thing. Use this operator to increment the variable counter by itself.
counter += counter
No comments:
Post a Comment