Q. What is the output of the below Java program with a SWITCH statement?
Code:
int points=6;
switch(points)
{
case 6: ;
case 7: System.out.println("PASS");break;
case 8: ;
case 9: System.out.println("Excellent");break;
case 10: System.out.println("Outstanding"); break;
default: System.out.println("FAIL");
}
β
Correct Answer: (A)
PASS