Puzzle L23


Print a n by n square divided into quadrants of stars, dots, dollars, and ohs

[M-12]Write a main() program that prints an n by n square of characters. Divide the square into quarters, and fill each quarter with a different character. Here is the output when n==15:

*******........
*******........
*******........
*******........
*******........
*******........
*******........
$$$$$$$oooooooo
$$$$$$$oooooooo
$$$$$$$oooooooo
$$$$$$$oooooooo
$$$$$$$oooooooo
$$$$$$$oooooooo
$$$$$$$oooooooo
$$$$$$$oooooooo

For extra fun, make n and the characters for each quadrant command line parameters. (But the answer does not do this.)



Answer         Next Page         Previous Page Home