1
do 
{   
    printf("Height: \n");
    h = GetInt();
}
while (h < 1 || h > 23);

errors below. mario.c

This is what I've done so far for mario.c and even though the output is similar to the requirements I'm still getting errors. Any advice on where I went wrong but be great.

1 Answer 1

0

Interesting. I ran your code and only see one fail - input of 0 rows. The instructions were to accept any non-negative up to 23. Perhaps you forgot that this INCLUDES 0 through 23? Your code needs to be able to "print a pyramid of 0 rows." If you make "1" simple change, your program should work 100%.

As for the other errors, I'm thinking that you may be running an earlier version of the code?

If this answers your question, please click the check mark to accept this and remove the question from the unanswered pool. Let's keep up on forum maintenance. ;-)

1
  • Thanks for that I didn't consider the 0. I changed my parameters to while (h < 0 || h > 23) and it passed all the checks.
    – Lmd
    Sep 10, 2015 at 17:36

You must log in to answer this question.

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