Demonstrates nesting two for statements - C Statement

C examples for Statement:for

Description

Demonstrates nesting two for statements

Demo Code

#include <stdio.h>

void draw_box( int row, int column )
{
    int col;//from w  w  w .  j a va 2s  . c o  m
    for ( ; row > 0; row--)
    {
        for (col = column; col > 0; col--)
            printf("X");

        printf("\n");
    }
}


int main( void )
{
    draw_box( 8, 35 );

    return 0;
}

Result


Related Tutorials