Rewrite the following statements using augmented assignment operators.
a. x = x + 1
b. x = x * 2
c. x = x / 10
d. x = x - 100
a)
Given statement: x = x + 1
The augmented assignment is used for the sake of writing short code statements.
The augmented assignment operators of x = x + 1 is x +=1
b)
Given statement: x = x * 2
The augmented assignment is used for the sake of writing short code statement.
The augmented assignment operators of x = x * 2 is x*=2
c)
Given statement: x = x/10
The augmented assignment is used for the sake of writing short code statement.
The augmented assignment operators of x = x/10 is x/=10
d)
Given statement: x = x -100
The augmented assignment is used for the sake of writing short code statement.
The augmented assignment operators of x = x -100 is x-=100