What is the output of the following code snippet? final int COST = 583; int digit = COST % 10; if (digit != 500) { System.out.println("500"); } else { System.out.println("Not 500"); } There is no output due to compilation errors. 500 Not 500 500 Not 500

Respuesta :

Answer:

500

Explanation:

  • COST = 583

583 % 10 = 3

  • digit = 3

if (digit != 500) then print "500"

3 != 500 ---> System.out.println("500");