continue C# with Example
In addition to break, there is also the keyword continue. Instead of breaking completely the loop, it will simply skip
the current iteration. It could be useful if you don't want some code to be executed if a particular value is set.
Here's a simple example:
for (int i = 1; i <= 10; i++)
if (i < 9)
Will result in:
Note: Continue is often most useful in while or do-while loops. For-loops, with well-deﬁned exit conditions, may not
beneﬁt as much.