Introduction
Iteration Statements are often known as looping, and they run many times while specific condition is true. I would try to explain some of them here. The lesson is for a begginer, and I guess that everyone need to know them.
While
The While loop function used and while the condition is true, the loop statement executed.
the genral form of while loop:
Code:
while (Boolean exception)
statement or block of statements
Code: CSharp
using System;
class Program
{
static void Main(string[] args)
{
int i;
i=0;
while (i < 20)
{
Console.WriteLine(i);
i++;
}
}
}
Do...While
The do while is exactly as the While loop, and its run while the condition is true, and when the condition is true the compiler goes to the do block statement, and he runs it.
The genral Form OF the Do....while:
Code:
do
statement or a block of statement
while(booleans expression);
Code: CSharp
using System;
class Program
{
static void Main(string[] args)
{
int i;
i=0;
do
{
Console.WriteLine(i);
i++;
}while(i<20);
}
}

