I am having a problem printing the spaces. The code I have gets the number as required. It prints out the number of hashtags desired based on user input. However, there are no spaces. Where can I send my code for someone to direct me to a better line of thinking?

Yes I wrote it out, yes I have a basic idea of what makes the spaces: user input - hashtags = spaces and decrease spaces by 1 until equal to zero

  • You could go to any of the discussion forums listed in the class discussion section. A lot of us hang out on CS50x slack. HAving said that, if you're printing the hashes correctly, you're almost there. Instead of trying to print spaces, try printing something else, like ! or + so that you can see and count them and work through it. Once you get it right, then just replace that character with a space.
    – Cliff B
    Commented Sep 3, 2015 at 6:26
  • please edit your question with your code and lets see if we can diagnose it Commented Sep 3, 2015 at 13:50
  • You can directly paste your code here or you may also use "paste-bin" to generate a link to your code. Its easier to answer if code is included. Commented Sep 6, 2015 at 7:02

1 Answer 1


If you have a correct method for printing the right number of #hashtags and increasing that number each line, then the same logic for printing and changing the number of spaces each line will work except rather than using ++ use -- and make sure your starting amount is derived from the user input -1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .