Computer Applications

The output of 42 / 6 % 2 is:

  1. 1
  2. 10
  3. 2
  4. 0

Java Operators

6 Likes

Answer

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

Answered By

3 Likes


Related Questions