This article explains some very useful concepts of C#, these are also called loops. I'll explain and differentiate them with an example.
![Loops]()
Break Statement
A Break statement breaks out of the loop at the current point or we can say that it terminates the loop condition.
It is represented by break;
Continue Statement
A Continue statement jumps out of the current loop condition and jumps back to the starting of the loop code.
It is represented by continue;
Example | Break vs Continue
This example shows the functioning of both of the statements together, afterwards, I'll explain them one by one with their functionality.
Output window
![Break and Continue]()
Explanation
In this example, the output is from 0 to 7 except 5, 8, 9?
Case 1. It is because in the first case
In other words, it will skip the current loop and jump to the top of the loop, so there is no 5 in the output window.
Case 2. In the second case
It will terminate the loop or get out of it when the value becomes 8, so there is no 8 or 9 in the output window.
Now let's make some changes in the code and see what happens, here we go.
![Loop Explanation]()
Now you can see the output. The condition continues to flow depending on the continued statement functioning.
Now I am making some other modifications, in the code snippet, as
![Continue flow]()
Now you can see, it is again showing from 0 to 7 and because of the break statement condition, it's again out of the loop so there is no 8, 9, or 10.