0

Hi everyone I made sure to do my research and go through the already posted questions. I am certain my while condition is wrong after research but don't understand the correction. my program runs but will accept negative number but once over 23 it finishes and will not move onto my pyramid.

enter image description here

1
  • No spaces in b/w function and (): get_int(). Also looks like you forgot to re-compile after making changes to your C program
    – C--
    Apr 16 at 10:07
0

Your do..while looks correct. If you have problems with it, you most likely forgot to save, forgot to compile, or called a completely different executable.

However I do see some problems with your inner loops. First printed row should contain height-1 spaces and two hashes, but you have height+1 spaces and height-1 hashes (but those hashes for any row!). I used row variable (I use singular name for a number referring to a specific row) in both loops.

You must log in to answer this question.

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