I apologize for my awful formatting - I am also new to this forum. I now understand why my program was not working. Is there a way I can achieve this pyramid without including the iomanip command?
<iomanip> is a header of C++ so don't be afraid of it!. Don't forget: we are in the text mode and the text mode of any console has no many facilities. <iomanip> header is specially made to "manipulate" the output of a code and has many built-in functions, so please take a look here:
What @condor is telling you is correct but a little advanced for a raw beginner. The purpose of the assignment is to get practice writing loops. The <iomanip> header is included to allow you to use the setw() function which basically allocates k+5 spaces for the first digit you print out, effectively padding the left side of the pyramid with k+4 spaces.
For your assignment, you should skip the setw() statement and replace it with a loop that prints out spaces for you.