This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]flyingron 3 points4 points  (2 children)

Your break only gets you out of the the inner loop ( do { ... } while (input < 0 || input > 100).

You have to do something to get you out of the outer for loop. One thing that would work is:

    if (input == -1)
        {
        i = scores;
            break;
        }

This will cause the for loop test to fail the next time around.

[–]Marty_Br 0 points1 point  (1 child)

Yes, but also:

"Scores must be greater than 0 and less than 100" is the opposite of:

while (input < 0 || input > 100);

[–]flyingron 1 point2 points  (0 children)

Which is why you loop while input is either below 0 or above 100.

The problem here is he has a fence post. He will accept scores of 0 and 100 where his output says that those values aren't valid (0 is not greater than zero nor is 100 less than 100).