QUIZ 1

What is the output?

a. 14
b. 16
c. 18
d. None if these

Answer : b

Expression in above code can be evaluated as
y=x++ + x + x++ + x
since, post increment operator is used, thus, value of x is used first, then, changed.
y=3+4+4+5
y=16

Leave a Reply

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