Iteration statements help execute a loop for a specific number of times or while a conditional expression is met. All of the statements in a code block are executed in sequence when a loop initiates. If the program encounters a jump statement or continue statement, the execution flow is altered for that scenario. In the case of go-to, control moves to the labeled code block and, in the case of continue statement, the loop ignores all of the statements after continue.
The following are the keywords that are used in C# when an iteration or a loop is required:
- do
- for
- foreach...in
- while