Tips for symbol patterns
- For shapes on a square grid, write a single condition in terms of
iandjthat is true exactly where the symbol should appear. - Print the symbol and the blank with the same width (for example
"# "and" ") so the columns stay aligned. - Plus and X shapes look best with an odd
n, so there is a single middle row and column.
Frequently asked questions
What is the difference between symbol patterns and star patterns?
Only the character changes. The loops and conditions are the same, so any star pattern can become a symbol pattern by printing a different character.
How do I print a pattern with a symbol entered by the user?
Read a character into a variable (for example char ch) and print that variable instead of the fixed symbol.
Why is the X pattern condition i + j == n + 1?
On the anti-diagonal, the row number increases as the column number decreases, so their sum stays constant at n + 1.









