Home / Questions / Give the output of the following expression: a+= a++ + ++a + --a + a-- ; when a = 7
Explanatory Question

Give the output of the following expression:

a+= a++ + ++a + --a + a-- ; when a = 7

👁 87 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

    a+= a++ + ++a + --a + a--
⇒ a = a + (a++ + ++a + --a + a--)
⇒ a = 7 + (7 + 9 + 8 + 8)
⇒ a = 7 + 32
⇒ a = 39