CBSE Class 11 Computer Science Question 88 of 173

Data Handling — Question 17

Back to all questions
17
Question

Question 17

What are augmented assignment operators? How are they useful?

Answer

Augmented assignment operators combine the impact of an arithmetic operator with an assignment operator. For example, to add the value of b to the value of a and assign the result back to a then instead of writing:

a = a + b

we can write

a += b.

Augmented assignment operators are useful as they provide a shorthand way by combining the arithmetic and assignment operators.

Answer