If I have the following code that produces a center aligned pyramid, how can i remove the middle stars of the pyramid so that I have just the outline?
See picture at end of code for example.
Here you are outputting x stars
Instead output one star (it will be left one), then outpust spaces instead of middle stars, then output another star (it will be the right one)
You will need to handle first and last rows differently.
You should handle first and last row separately.
so you should output row/2 spaces, then star (first row);
Then run your loop with x starting from 2;
Then output row*2 + 1 stars (last row)
Could you please show me? This is not working out for me. And how are you outputting the last row. Because when I use that piece of code it changes the stars to number instead
No. There should be loop which you already made and it is working for you. That loop which in your original code was on lines 14-32 and which you modified later .
I asked you to place loop inside provided code, not provided code inside loop.
Remove lines 14, 15 and 45;
and I do not see star output inside your loop like you show in this message: http://www.cplusplus.com/forum/beginner/135010/#msg720770