Well, you aren't using every position in your array:
your array size is 10, which means it has an index of {0,1,2,3,...8,9}, starting from zero up to 9, which gives you a total of 10.
But the way your for loop is working, is at one point count will be equal to 10 and you will be trying to store data into position value[10] of your array, but as noted above, isn't allocated for your array, and could give you possible errors. A better way to go about it would be.
1 2 3 4 5
|
for (int count = 0; count < arraySize; count++)
{
cout << "Please enter the value for element number " << count+1 << endl;
cin >> value[count];
}
|
that will still give you same output, but without going out of bounds on your array.
and as for finding the larges and smallest values in your array:
1 2 3 4 5 6 7 8 9 10 11
|
//declare variables for smallest and largest
int smallest = 0, largest = 0;
//for loop to find the smallest and largest
for (int count1 = 0; count1 < arraySize; count1++){
if (smallest > value[count1])
smallest = value[count1]
if(largest < value[count1])
largest = value[count1])
}
|
try something like that