Operations with Assignment
The readability of the code is very important, so now we will consider the possibilities to make the code more beautiful.
There are math operations with the assignment:
- addition assignment (
- subtraction assignment (
- multiplication assignment (
- division assignment (
- remainder (modulo) assignment (
- exponentiation assignment (
Assignment operators are used to improve code readability.
Look at the example:
a += 5 replaces the
a = a + 5.
Let's look at other replacement to understand how it works: