QUESTION IMAGE
Question
int a = 35;
int b = 13;
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?
awesome
totally
totally awesome
Step1: Calculate a % b
$a = 35$, $b = 13$. $35\div13 = 2\cdots\cdots9$, so $a\%b=9$.
Step2: Check the first if condition
Compare $a\%b$ and $c$. $c = 11$, $9<11$, so the first if - condition ($a\%b>c$) is false.
Step3: Calculate $a + - 2*b$
$a = 35$, $b = 13$. $a+(-2)*b=35 - 26 = 9$.
Step4: Check the second if condition
Compare $a + - 2*b$ and $c$. $c = 11$, $9<11$, so the second if - condition ($a + - 2*b
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
awesome