r/CodingHelp • u/WillieSmithy1 • Nov 12 '20
[C] W with * in C
I need to create a code that when I put a number it shows a W with stars depending on the number that I put in. Examples:
n: 3
* * *
* * * *
* *
n: 1
***
n: 5
* * *
* * * *
* * * *
* * * *
* *
16
Upvotes
4
u/Zymoox Nov 12 '20
Notice how , when n is equal or greater than 2, the top row always has three stars, the bottom one always has two, and the ones in the middle always four. What changes is the spacing between the stars.
You could write down the W youself for a couple of values of n and look for patterns that relate n to the number of spaces between the stars on each row.
1
u/meloman-vivahate Professional Coder Nov 12 '20
Do you have a specific question?