In a switch statement, each case ends with the ______ keyword to prevent fall-through.

  • break
  • continue
  • goto
  • return
In a switch statement in C++, each "case" ends with the "break" keyword. The "break" statement is crucial in switch statements to prevent fall-through, meaning that once a case is matched and its code block is executed, the program exits the switch block.
Add your answer
Loading...

Leave a comment

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