I am having a problem printing out the results for my code, It is supposed to print out the largest and smallest value in the array, but keeps giving me a value not entered and I don't know why. Any information is appreciated.
//This program lets the user enter 10 numbers and then display the highest and lowest number.
#include <iostream>
#include<stdio.h>
usingnamespace std;
int main()
{
constint NUM_ENTERED = 9;
int number[NUM_ENTERED], highestValue = number[0], lowestValue = number[0], count=0;
//Recieve the numbers
cout << "Please enter the numbers:" << endl;
cin >> number[0];
cin >> number[1];
cin >> number[2];
cin >> number[3];
cin >> number[4];
cin >> number[5];
cin >> number[6];
cin >> number[7];
cin >> number[8];
cin >> number[9];
//Runs a loop to decide which number is the HIGHEST and LOWEST number in the array
//I AM HAVING A PROBLEM WITH THE CODE HERE
while (count < 10){
if (number[count] > highestValue){
highestValue = number[count];
}
if (number[count] < lowestValue){
lowestValue = number[count];
}
count ++;
} //end loop
//Prints the results
cout << "The highest number entered was: " << highestValue << endl;
cout << "The lowest number entered was: " << lowestValue << endl;
system("pause");
return 0;
} //end main