Nested loops with Different max values in C

Notes:

Nested for loops with Different max values in C Programming Language:

Case 2: nested for loops with different max values

for(i=0; i<m; i++) // outer for loop
{
for(j=0; j<n; j++) // inner for loop
{
sequence of statement(s); // m x n times
}
}

Ex 1:
int i=0;
int j=0;

for(i=0; i<2; i++)
{
for(j=0; j<3; j++)
{
printf("Hello World\n"); // 2 x 3 = 6 times
}
}

Ex 2:
int i=0;
int j=0;

for(i=0; i<3; i++)
{
for(j=0; j<2; j++)
{
printf("Hello World\n"); // 3 x 2 = 6 times
}
}