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:

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);
					}