- Nested do while loop
- Syntax of nested do while loop
- Example of nested do while loop
Nested do while loop:
A nested do while loop(statement) in C is nothing but, When one or more do while loop are declared within block of another do while loop such condition is called nested do while loop(statement) in C.
The first do while loop in nested loop is treated as outer do while loop in another hand other do while loops which are declared within the block of another loop is treated as inner do while loop.
Syntax of nested do while loop:
do
{
Statement 1;
do
{
Statement 1;
.
.
Statement n;
}
while(condition);
Statement 2;
Statement 3;
.
.
Statement n;
}
while(condition);
Example of nested do while loop:
#include<stdio.h>
int main()
{
int i,j,n=1;
i=1;
printf("\n table from 1 to 10--\n);
do
{
j=1;
do
{
printf( " %4d ", n*j);
J++;
}while(j<=10);
printf("\n");
n++;
i++;
}while(i<=10);
return 0;
_____________________________________________________________
_____________________________________________________________
Conclusion:
In this article we have learned about nested do while loop in detail with its example and syntax I hope, after reading this article you have no any doubt remain, but still if you have any doubt then feel free comment below.

