>>297371Your for loop is pretty funky. You already check if the last value entered was -999 while you are in the loop so there is no reason to include it in the for loop definition. This means that the check you do after scanf'ing a value will have to change to match the value read in instead of i. Additionally you do not have to decrement count if you just put the increment after the if statement since only valid input will cause the count to go up.