1(iv)
The output of 42 / 6 % 2 is:
- (a)1
- (b)10
- (c)2
- (d)0
Show SolutionHide Solution↓
1
Reason — According to operator precedence in Java, division (/) and modulus (%) have the same priority and are evaluated from left to right.
42 / 6 % 2
= 7 % 2
= 1