// simple program using a counter-controlled while loop // reads 5 integers from the terminal and computes (and outputs) // both the smallest and the largest #include main () { int numb, min, max, count = 1; cout << "Please input an integer: "; cin >> numb; min = max = numb; count = 2; while (count <= 5) { 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; }