Using dependent nested for loops - C Statement

C examples for Statement:for

Description

Using dependent nested for loops

Demo Code

#include <stdio.h>

int main(void)
{
    const int ROWS = 6;
    const int CHARS = 6;
    int row;/*from w  ww  .  ja va2 s . c o m*/
    char ch;
    
    for (row = 0; row < ROWS; row++)
    {
        for (ch = ('A' + row);  ch < ('A' + CHARS); ch++)
            printf("%c", ch);
        printf("\n");
    }
    
    return 0;
}

Result


Related Tutorials