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

Which of the following prints \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site