Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

int a = 35; int b = 13; int c = 11; if (a % b > c) system.out.println(\…

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

Explanation:

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

Answer:

awesome