What would be the output of a switch statement if none of the case or default labels are met?

  • 0
  • Compilation Error
  • No Output
  • Undefined
If none of the case labels are met in a switch statement, the control flow falls through to the next statement after the switch block. This means that if there are no case labels that match the switch expression, the output would be the result of executing the code immediately after the switch statement. In this case, the output would be 0.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *