ICSE Class 10 Computer Applications Question 18 of 26

Operators in Java — Question 18

Back to all questions
18
Question

Question 18

Evaluate the following expressions, if the values of the variables are a = 2, b = 3 and c = 3

i. a - (b++) * (--c)

ii. a * (++b) %c

Answer

i.  a - (b++) * (--c)
⇒ 2 - 3 * 2
⇒ 2 - 6
⇒ -4

ii. a * (++b) %c
⇒ 2 * 4 % 3
⇒ 8 % 3
⇒ 2