Nested loop: -
When one loop is enclosed with in other loop, then this kind of loop is called nested loop.
It may be a nested loop for loop.
It may be a nested while loop.
It may be nested do while loop.
If it is nested for loop then its syntax will be as:
For (variable 2 = initial value; condition; increment \ decrement)
{
For (variable 2 = initial value; condition; increment \ decrement)
{
} body of loop
}
}
The start loop is called outer loop and the end loop is called inner or internal loop. For each number of outer, the inner loop completes its whole cycle.
Posted by: Wasim Javed
No comments:
Post a Comment