When the following code is executed, what will be the value of $x$ and $y$?
int x = 1, y = 0;
y = x++;
🎥 Video solution / Text Solution of this question is given below:
Post-increment assigns old value of $x$ to $y$, then increments $x$.
So $y = 1$, $x = 2$.