Q. Without a break statement in switch what will happen?

  • (A) All cases will work properly
  • (B) Cases will fall through after matching the first check
  • (C) Switch will throw error
  • (D) All of these
πŸ’¬ Discuss
βœ… Correct Answer: (B) Cases will fall through after matching the first check
Explanation: The break statement is used to terminate the current flow of code. And if it is not present in the switch statement, the cases will execute all cases after the matched case.
Explanation by: Chandani
The break statement is used to terminate the current flow of code. And if it is not present in the switch statement, the cases will execute all cases after the matched case.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
553
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Chandani
Publisher
πŸ“ˆ
90%
Success Rate