Write a program that accepts an integer "n" and prints the following picture of a diamond with 2n-1 rows
Number #3:
Attachment 2343
I really need help with this i have no idea where to start.
Printable View
Write a program that accepts an integer "n" and prints the following picture of a diamond with 2n-1 rows
Number #3:
Attachment 2343
I really need help with this i have no idea where to start.
Don't worry about the whole problem, just work on smaller parts and build upon. Can you write code to produce:
If so then you are half way there. All you need to do after that is to repeat the pattern but upside down. Depending upon how you wrote the program you might end up with 2 middle lines. If so then work out how to eliminate one.Code :
X XXX XXXXX
Start with a piece of paper (graph paper would work well). Write down the all the X's for 3 or 4 lines. Then count how many X's and how many spaces are on each line. Do you see a pattern?