QUIZ 2

What is the output?

a. 10 9 10
b. 1 9 10
c. 1 10 9
d. 1 9 9

Answer : c

In inner block value of x is local so it is destroyed when it comes out of that block
So, there x=1
In x– value of x is printed 10 first then decreased by 1.
In x++ value of x is printed 9 and then, increased by 1.

Thus, output is 1 10 9

Leave a Reply

Your email address will not be published. Required fields are marked *