Find numbers above and below the average.

I am working on a lab problem and I feel like I pretty close. I am supposed to take in 10 numbers from the user. After that I will output several things. The part where I am stuck is displaying numbers that are above and below the calculated average. The average is fine, but I keep getting an error code on line 22 of the program.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include<iostream>
using namespace std;
int main()
{
	int count;
	const int Size = 10;
	cout << " Please enter 10 numbers: ";
	int numbers[10];
	int sum = 0;
	int avg;
	int high = 0;
	int low = 0;
	for (int i = 0; i < 10; i++)
	{
		
		cin >> numbers[i];

	}
	for (int i = 0; i < Size; i++)
		sum = sum + numbers[i];
	avg = sum / Size;
	for (count = 0; count < numbers; count++)
	{
		if (numbers[count] >= avg)
			high++;
		else
			low++;

	}
	
	cout << "\nThe third and seventh numbers are: ";
	cout << numbers[2] << ", ";
	cout << numbers[6] << endl;
	cout << "The average is: " << sum / Size << endl;
	cout << "The numbers above the average are: " << high << endl;
	cout << "The numbers below the average are: " << low << endl;
		return 0;

	}
closed account (48T7M4Gy)
count < Size not count < numbers ?
Sorry but I don't quite know what you are trying to say.
You're error comes from the fact that numbers is an array, so you're trying to see if an int < int*, which makes no sense. I think what you meant to put there is for (count = 0; count < Size; count++) That way you're checking to see if count is still less than the total number of elements in the numbers array rather than checking to see if count is less than the memory address of the array.
Yes that does seem painfully obvious now that you pointed it out. Thanks for all the help.
Topic archived. No new replies allowed.