QUESTION IMAGE
Question
int a = 2; int b = 3; int c = 4; 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 awesome awesome no output is generated.
Step1: Analyze first if - condition
Given int a = 2;, int b = 3;, int c = 4;. The first if - condition is if (a + b > c). Calculate a + b: $a + b=2 + 3=5$. Since $5>4$, the statement System.out.println("totally"); will execute.
Step2: Analyze second if - condition
The second if - condition is if (a 2 + b != c). Calculate a 2 + b: $a * 2 + b=2\times2 + 3=4 + 3 = 7$. Since $7
eq4$, the statement System.out.println("awesome"); will execute.
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
The output will be "totally" followed by "awesome".