1

My output is fine however check50 says:

:( handles a height of 0 correctly
   \ expected an exit code of 0, not output of "Height: "
2

Per the specs:

However, to make things more interesting, first prompt the user for the half-pyramid’s height, a non-negative integer no greater than 23.

So, non-negative means height can be from 0 to 23 both inclusive.

So in case of an input 0, you should print a pyramid of 0 height, and return 0. Not re-prompt for Height:.

Happy coding! :)

0

Answer

change while (hpyrh < 1 || hpyrh > 23); to while (hpyrh < 0 || hpyrh > 23);

2
  • Good work finding it yourself! Accept your answer to mark your question as answered! :) – ChrisG Aug 4 '16 at 7:42
  • 1
    @ChrisG The platform will let me do what you suggested in 2 days. Thanks for your assistance! – Salamit Aug 4 '16 at 8:50

You must log in to answer this question.

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