Which of the following prints even whenever a is a multiple
Which of the following prints \"even\" whenever a is a multiple 2 in java?
if a%2 == 0 System.out.println(\"even\");
if (a%2) System.out.println(\"even\");
if (a==2) System.out.println(\"even\");
if (a%2 == 0) System.out.println(\"even\");
Solution
Answer:
if (a%2 == 0) System.out.println(\"even\");
This is the one which prints even whenever a is a multiple 2 in java
