C Language

June 2, 2023

How to understand nesting loops in C Language

Program to understand nesting loops in C Language


#include 
int main(viod)
{
    int i, j;
    for (i = 1; i <= 3; i++)
    {
        printf("i=%d\n", i);
        for (j = 1; j <= 4; j++)
        {
            printf("j=%d\t", j);
        }
        printf("\n");
    }
    return 0;
}

output


i=1
j=1 j=2 j=3 j=4
i=2
j=1 j=2 j=3 j=4
i=3
j=1 j=2 j=3 j=4

by : Nadeem Khan

Quick Summary:

Program to understand nesting loops in C Language copy #include int main(viod) { int i, j; for (i = 1; i