Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

int a = 14; int b = 3; int c = 11; if (a - b == c) system.out.println(\…

Question

int a = 14;
int b = 3;
int c = 11;
if (a - b == c)
system.out.println(\totally\);
if (a + 2 * b > c)
system.out.println(\awesome\);
what is the output of the program?
totally awesometotallyawesome

Explanation:

Step1: Calculate \(a - b\)

Given \(a = 14\), \(b = 3\), then \(a - b=14 - 3=11\). Since \(c = 11\), the condition \(a - b = c\) is True. So, "totally" is printed.

Step2: Calculate \(a + 2*b\)

\(a+2*b=14 + 2\times3=14 + 6 = 20\). Given \(c = 11\), since \(20>11\), the condition \(a + 2*b>c\) is True. So, "awesome" is printed.

Answer:

totally awesome