QUESTION IMAGE
Question
what will be the output of this code?
int x = 13;
int y = 3;
int a = y;
y = x;
x = a;
system.out.print(x);
Step1: Initialize variables
$x = 13$, $y = 3$, $a = y = 3$
Step2: Update y with x's value
$y = x = 13$
Step3: Update x with a's value
$x = a = 3$
Step4: Output the final x value
The code prints the current value of $x$.
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
3