Why does the code below stop executing after displaying all the numbers stored in an array?
//this will let the user enter 10 values and
//store them into an array. After that
//sort it out and cout the largest and the smallest number entered
#include <iostream>
using namespace std;
int main()
{
const int NUM_ARRAY = 10; //number of numbers to be entered
int numHolder[NUM_ARRAY]; // where the numbers will be stored
int count; //accumulator
int highest; //highest number
int lowest; //lowest number
//input the numbers
for (count = 0; count < NUM_ARRAY; count++)
{
cout << "Please enter series of numbers"
<< (count + 1) << ": ";
cin >> numHolder[count];
}
//show the numbers entered
cout <<"The numbers you entered are: \n";
for (count = 0; count < NUM_ARRAY; count++)
cout << numHolder[count]<< endl;
//pick the highest number
cout << "The highest is: ";
highest = numHolder[0];
for (int hcount = 0; hcount < numHolder[count]; hcount++)
{
if (numHolder[count] > highest)
highest = numHolder[count];
}
return 0;
}