Using arrays to get min, max,mean and range of positive numbers excluding the non-positive

I am relatively new to C++ and I have a presentation tomorrow based on the following question.
Write a C++ program to read a sequence of (non-negative) integers from the user ending with a negative integer and write out

the average of the numbers
the smallest number
the largest number
the range of the numbers (largest - smallest)
so that if the numbers are for instance:3,1,55,89,23,46,-1 the program only computes the positive values only

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
  #include <iostream>
using namespace std;
int main() {
    int minimum;
    int maximum;
    int range;
    int average;
    int n[6]
while(n>=0){
        if(a>b&&a>c&&a>>d&&a>>e)
        {
            cout<<a<<endl;//max value
        }
    else if (b>a&&b>c&&b>d&&b>e)
    {
        cout<<b<<endl;//max value
    }
    else if (c>a&&c>b&&c>d&&c>e){
        cout<<c<<endl;//max value
    }
    else if(d>a&&d>b&&d>c&&d>e){
        cout<<d<<endl; //max value
    }
    else(){
        cout<<e<<endl; //max value
    }
        
}
}



I know I really need help because I cannot proceed from there tbh some arguments are also grave wrong.
I wrote a solution to a similar problem yesterday. Take a look: http://www.cplusplus.com/forum/beginner/137570/
See the code at the end.

if(a>b&&a>c&&a>>d&&a>>e)

is that a typo or what?
Line 8: Missing ; Not initialized.

Line 9: Using unsubscripted n. Compiler will assume you mean the base address of the array (a pointer).

Lines 10-25: a,b,c,d,e are not defined.
Registered users can post here. Sign in or register to post.