Q. What is the output of Java program below?

Code:
int num=40;
switch(num)
{
case 5: System.out.println("FIVE"); break;
case 35+5: System.out.println("FORTY"); break;
case 20+30: System.out.println("FIFTY");
}
  • (A) FIVE
  • (B) FORTY
  • (C) FIFTY
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) FORTY

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
249
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
99%
Success Rate