Brittany, you can't do cin >> number[i]..That will not read a value and store it in the array...Do something like this: ...Remember to add to my reputation!
cin >> num;
numbers[i] = num;
cin >> numbers[i];
works fine. The way you did it works too, but involves an extra step. You don't have to read from cin into an integer, then assign that integer to the array. Reading it directly from cin into the array works too.
VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
Brittany, you can't do cin >> number[i]..That will not read a value and store it in the array...Do something like this: ...Remember to add to my reputation!
That isexactly how to read in a value into the array. Don't know where you get the idea it can't.
//Find the average
average = ( numbers[TOTAL_NUMBERS] + numbers[TOTAL_NUMBERS]) /10;
Since when is adding two numbers together then dividing by 10 giving an average?
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944