Iteration statements

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
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.55.18