Given:
What is the output?
The post-increment expression x++ uses x’s original value, 1, and subsequently changes x to 2. The pre-increment expression ++y changes y to 2 before comparison. Therefore, 1 < 2 is true, printing Hello , followed by Log 2:2.
x++
x
++y
y
1 < 2
Hello
Log 2:2
Community Discussion