Okay.... i tried this, but now i get a value of whatever the last number entered was. So, if my input is 1, 4, 8, -99... it ignores the -99, which is what I want, but it says the smallest number would be 8. .... what am I missing?
case 'b':
case 'B':
cout << " Enter a group of numbers. I will tell you the smallest number. \n Enter " << SENTINEL << " to exit." << endl;
counter = 0;
while (number != SENTINEL)
{ // open while 3
counter++;
cin >> number;
if (number > SENTINEL && temp2 != SENTINEL)
temp2 = number;
}
cout << "Your smallest number out of " << counter << " was " << temp2 << "." << endl;
cout << endl;