What is the primary difference between the continue and break keywords in a loop control structure?

  • "Continue" and "break" are identical
  • "Continue" and "break" generate compilation errors
  • "Continue" moves to the next iteration of the loop, while "break" terminates the loop
  • "Continue" terminates the loop, while "break" moves to the next iteration
The primary difference between "continue" and "break" is that "continue" moves to the next iteration of the loop, skipping the remaining code in the current iteration, whereas "break" terminates the loop altogether and moves to the code after the loop.
Add your answer
Loading...

Leave a comment

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