Puzzle L16


Print N by M block of stars

[E-5]Write a main() program that prints N lines of M stars each, as follows for N==7 M==21:

*********************
*********************
*********************
*********************
*********************
*********************
*********************

If you want, ask the user for the value N and M; or else, just hard-wire those values into your program.

Here is a skeleton:

#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 (  )
  {
    for (   )
      printf("*");
    printf("\n");
  }
  
  
  return 0;
}



Previous Page        Answer         Next Page         Home