ICSE Class 10 Computer Applications Question 12 of 26

Operators in Java — Question 12

Back to all questions
12
Question

Question 12

If x = 3, y = 7, calculate the value of:
x -= x++ - ++y

Answer

    x -= x++ - ++y
⇒ x = x - (x++ - ++y)
⇒ x = 3 - (3 - 8)
⇒ x = 3 - (-5)
⇒ x = 3 + 5
⇒ x = 8