Hi I'm having problems with a homework assignment. The task is to write a C++ program that allows the user to enter as many non-negative integers as they would like. When the user enters a negative number, stop collecting numbers and output to the console the largest and the smallest number entered (not counting the negative number).
I currently have it working except that my negative number is included in my lowest value. Please help.
I know the while loop does that, but since it's a do while loop it would count in the negative number first then exit out of the loop; that's what I was trying to get you out of.
I know. But i have to have it keep on repeating infinitly until the user enters a negative number. Then it HAS to stop and display the high and low number of the numbers entered (not including the negative number that was entered).
I was saying with mine that when you have entered a negative number it would go through and add it to the low number, which is not what you wanted to do. By adding the if statement stating that if the number was negative, then quit the while loop, it would be similar to the while loop doing so except with it adding the number to the lownumber variable.