#include <stdio.h>
#include <stdlib.h>
/* Puzzle L16 -- print a n by m block of stars */
int main()
{
int row, col;
int n=7, m=21;
for ( row=0; row < n; row++ )
{
for ( col=0; col < m; col++ )
printf("*");
printf("\n");
}
return 0;
}
Comment:
This is your basic loop within a loop.
The outer loop (the counter is row)
counts the rows.
The inner loop (the counter is col)
counts the characters in the current row.