Ok, no array. First you create two variable lowest_even and lowest_odd to store the lowest value of even and odd, or whatever you want to call them
Originally Posted by Greek_89
Then, use while to read in the number.
int lowest_even = 100; // using 100 as a sentinel
int lowest_odd = 100;
EDIT:: the sentinel value is no problem if you enter value below it. To work around it, just assign the first even read in to lowest_even, and the first value read in for odd to lowest_odd. Didn't notice that this's in the C++ forum, forget the scanf then and just use cin.
if ( num % 2 == 0 && num < lowest_even)
lowest_even = num;
else if ( num < lowest_odd)
lowest_odd = num;