Loops in C#
Looping is a way in programming languages to execute a statement or a set of statements for a specified number of times depend on the result of condition until it becomes trues. The result condition should be true to execute the loop.
There are mainly two types of loops:
• Entry controlled loops
• Exit controlled loops
Entry controlled loops:
These are the loops in which the condition to be tested in the beginning of the loop body: for loop and while are the examples of entry controlled loops.
Exit controlled loops:
These are the loops in which the condition is to be tested at the end of the loop body. do-while is an example of such type of loop.
Note: in exit controlled type the code will be executed at least one time as the condition is tested at the end of the body.