Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

what is the output of this code fragment? int a = 2 * 4; int b = 7 * 2;…

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);

Explanation:

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"

Answer:

8 14 22