Important Notice:

Course Content
Building IoT Applications (Chapter-4) M4-R5.1
About Lesson

Nested for loop

          We can also have nested for loops, i.e one for loop inside another for loop. nesting is often used for handling multidimensional arrays.

 

Syntax:

for(initialization; condition; increment/decrement)

{

for(initialization; condition; increment/decrement)

{

statement ;

}

}

Example:

main()

{

for (int i=0; i<=5; i++)

{

for (int j=0; j<=5; j++)

{

printf(“%d, %d”,i ,j);

}

}

}

error: Content is protected !!