array

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
#include <iostream>

int main()

{
	using namespace std;
	
	int i, numbers[10], max;
	int c, numbers[10], min;
	
	cout << "enter 10 numbers:\n";
	cin >> numbers[0];
	max = numbers[0];
	for (i = 1; i < 10; i++)
	{
		cin >> numbers [i];
		if (numbers[i] > max)
			max = numbers[i];
		if (numbers[c] < min)
			min = numbers[c];
	}
	
	cout << "the biggest number is" << max << endl
	cout << "the numbers and their n\";
	cout << "the smallest number is" << min << endl
	cout << "the numbers and their n\";
		
	return 0;
}

im trying to get the smallest and biggest numbers to output after i enter 10 random numbers... what am i doin wrong? 
Last edited on
You aren't initializing min
how wouild i do that?
as you did for max on line 13
ha i missed that thanks.
Topic archived. No new replies allowed.