Nested loops
Nested loops
C supports nesting of loops in C. Nesting of loops is the feature in C that allows the looping of statements inside another loop.
Any number of loops can be defined inside another loop, i.e., there is no restriction for defining any number of loops. The nesting level can be defined at n times. You can define any type of loop inside another loop; for example, you can define 'while' loop inside a 'for' loop.
Nested for Loop:
for(initial value; condition; increment/decrement) { //body of for loop for(initial value; condition; increment/decrement) { //body of for loop ........... statements; } statements; }