int a = 19 - 17; int b = a * 5; int c = a % b; what is the output of the following code fragment…

int a = 19 - 17; int b = a * 5; int c = a % b; what is the output of the following code fragment? system.out.println(a + \ \ + b + \ \ + c); 2 10 2 2 10 5 2 10 0
Answer
Explanation:
Step1: Calculate value of a
$a = 19 - 17=2$
Step2: Calculate value of b
$b=a5 = 25 = 10$
Step3: Calculate value of c
The % operator is the modulus operator, which gives the remainder of the division. So $c=a%b=2%10 = 2$
Answer:
2 10 2