Some points:
1. Use code tags to post your indented code so that it is more readable.
2. The loop you use for input can easily cause buffer overflows if zero is not entered by the user. If you know the array size in advance, replace all the cumbersome while loops with the for loops and repost your updated code.
3. You did a mistake in placing the logic for finding out the highest in the else block. Place it in a seperate if block.
4. Initializing your variables will save you a lot of head banging in the future. Always initialize your variables before using them in such situations.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
I still see a while loop in your code. On top of that the while loop uses the value of i which is 5 when the while block is entered (since you never reset it after the for loop).
Stop checking for the occurance of zero in the loop. Just make it like the loop you used for accepting user input.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734