// array demo - user enters fixed number of integers, // finds and prints minimum // mikhail nesterenko // 10/19/99 #include using std::cout; using std::endl; using std::cin; int main(){ const int arraySize=5; int numbers[arraySize]; // array of numbers // entering the numbers cout << "Enter the numbers: "; for(int i=0; i < arraySize; ++i) cin >> numbers[i]; // finding the minimum int minimum=numbers[0]; // assume minimum to be the first element for (int i=1; i < arraySize; ++i) // start evaluating from second if (minimum > numbers[i]) minimum=numbers[i]; cout << "The smallest number is: " << minimum << endl; }