Lesson #10 - Break and Continue

Updated: Dec 13, 2020

The break and continue statements are reserved words in C#. Their main use is in loops (and also on switch statement) to control the execution flow.

Break statement

The break statement is used to end the execution of a loop or a switch statement.

Continue statement

The continue statement is used to break one iteration in the loop base on a specified condition that if it occurs the current loop cycle will end and the next iteration of the loop will start.

1 view0 comments