QUESTION IMAGE
Question
what is the output of this code fragment?
int a = 2 * 4;
int b = 7 * 2;
int c = a + b;
system.out.print(a + \ \ + b + \ \ + c);
Step1: Calculate value of a
$a = 2 \times 4 = 8$
Step2: Calculate value of b
$b = 7 \times 2 = 14$
Step3: Calculate value of c
$c = a + b = 8 + 14 = 22$
Step4: Determine output string
Concatenate a, spaces, b, spaces, c → "8 14 22"
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
8 14 22