QUESTION IMAGE
Question
int a = 9 + 3; int b = a % 7; int c = a - b; what is output of the following code fragment? system.out.println(a + \ \ + b + \ \ + c); 12 1 11 12 5 7 12 4 3
Step1: Calculate value of a
$a = 9 + 3=12$
Step2: Calculate value of b
The % operator is the modulus operator. $b=a\%7 = 12\%7=5$ (since $12 = 1\times7+5$)
Step3: Calculate value of c
$c=a - b=12 - 5 = 7$
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
12 5 7