A loop statement allows us to execute a statement or group of statements multiple times and following is the general form of a loop statement in most of the programming languages
C programming language provides the following types of loops to handle looping requirements.
While loop
    A while loop statement in C programming language repeatedly executes a target statement as long as a given condition is true.
Flow diagram
Syntax
while(condition)
{
statement(s);
}
    Here, statement(s) may be a single statement or a block of statements. The condition may be any expression, and true is any nonzero value. The loop iterates while the condition is true.
When the condition becomes false, program control passes to the line immediately following the loop
For Loop
A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.
Flow diagram
Syntax
for ( init; condition; increment )
{
statement(s);
}
   Here is the flow of control in a for loop:
The init step is executed first, and only once. This step allows you to declare and initialize any loop control variables. You are not required to put a statement here, as long as a semicolon appears.Next, the condition is evaluated. If it is true, the body of the loop is executed. If it is false, the body of the loop does not execute and flow of control jumps to the next statement just after the for loop.After the body of the for loop executes, the flow of control jumps back up to the increment statement. This statement allows you to update any loop control variables. This statement can be left blank, as long as a semicolon appears after the condition.The condition is now evaluated again. If it is true, the loop executes and the process repeats itself (body of loop, then increment step, and then again condition). After the condition becomes false, the for loop terminates.
Do..While Loop
Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop in C programming language checks its condition at the bottom of the loop.
A do...while loop is similar to a while loop, except that a do...while loop is guaranteed to execute at least one time.
Flow diagram
Syntax
do
{
statement(s);
}while( condition );
Nested Loops
   C programming language allows to use one loop inside another loop. Following section shows few examples to illustrate the concept.
Syntax
The syntax for a nested for loop statement in C is as follows:
for ( init; condition; increment )
{
for ( init; condition; increment )
{
statement(s);
}
statement(s);
}
The syntax for a nested while loop statement in C programming language is as follows:
while(condition)
{
while(condition)
{
statement(s);
}
statement(s);
}

