/* minmax.cpp * Anthony Larrain * Fall 2002, csc309 * * This program will determine the minimum and maximum from a set of numbers * entered by the user. The user can enter any non integer character to * signal end of input. */ #include using namespace std; int main(int argc, char *argv[]) { double input_value; cout << "Enter in a sequence of integers. " << "(Use a non-integer character to for end of input)" << endl; cin >> input_value; // Check that at least 1 numeric value was entered if(!cin){ cout << "No values entered" << endl; system("PAUSE"); exit(1); } double min(input_value), max(input_value); while(cin >> input_value){ if(input_value < min){ min = input_value; } if(input_value > max){ max = input_value; } } cout << "The minimun value is\t" << min << endl << "The maximum value is\t" << max << endl; system("PAUSE"); return EXIT_SUCCESS; }