QUESTION IMAGE
Question
question 34
1 pts
what will be the value of x after the following code is executed?
int x, y = 15;
x = y--;
14
16
0
15
Step1: Understand post - decrement
In the statement x = y--;, the value of y is first assigned to x, and then y is decremented by 1.
Step2: Initial value assignment
The initial value of y is 15. So, the value of y (which is 15) is assigned to x first. Then y becomes 14.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
15