Puzzle L22


Print a n by m block of stars centered on a N by M background of dots

[M-22]Write a main() program that prints a block of stars centered inside a block of dots. Make n, m, N, and M constants of the program, or make them optional command line parameters. Here is the output when n==5, m==7, N==11, M==13:

.............
.............
.............
...*******...
...*******...
...*******...
...*******...
...*******...
.............
.............
.............

If you need an explanation of command line parameters, look at the answer (or check your C text book.)



Answer         Next Page         Previous Page Home