NESTED FOR LOOP

A nested for loop is a loop inside another loop. This allows you to create more complex looping structures and is often used for tasks that involve two-dimensional data structures, such as matrices or grids. The general syntax of a nested for loop in C is as follows:

for (initialization1; condition1; update1) {

    // code before the nested loop

 

    for (initialization2; condition2; update2) {

        // code to be executed in each iteration of the nested loop

        // ...

    }

 

    // code after the nested loop

}

write a program to print table of 2 to 10 using nested for loop

#include<stdio.h>

void main()

{

  for(int j=2 ;j<=10 ;j++)

{

  for(int i=1 ;i<=10 ;i++)

{

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

}

}

}