QUESTION IMAGE
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
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.
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
totally awesome