Utilizor
Contact Us

C++ Break/Continue

Controlling loop execution.

C++ Break and Continue

The break statement can be used to jump out of a loop completely.

The continue statement breaks one iteration (in the loop), if a specified condition occurs, and continues with the next iteration in the loop.

Break vs Continue

Break: Stops the loop entirely and moves to the code after the loop.

Continue: Skips the rest of the current iteration and jumps back to the condition check (in while loops) or update statement (in for loops).