If x = 5, what is the value of x after the statement y = x++;?
-
A
5
-
B
4
-
C
7
-
D
6
Correct answer
15 views
Explanation
The postfix operator returns the old value to y and then increments x, so x becomes 6.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ