// simple program using a counter-controlled while loop // first queries the user for the number of integers to be considered // reads the integers from the terminal and computes (and outputs) // both the smallest and the largest // // NOTE SHOULD CHECK THAT INPUT NUMBER > 0!!!!!! #include main () { int numb, min, max, total, count = 1; cout << "This program computes the smallest and largest of "; cout << endl << "\t\tthe input integers."; cout << endl; cout << "Please input the number of integers you wish it to consider: "; cin >> total; cout << "Please input an integer: "; cin >> numb; min = max = numb; count = 2; while (count <= total) { cout << "Please input an integer: "; cin >> numb; count = count + 1; if (numb < min) min = numb; if (numb > max) max = numb; } cout << "The smallest number is " << min << endl; cout << "The largest number is " << max << endl; return 0; }