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
#include <iostream>
usingnamespace 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
}
elseif (b>a&&b>c&&b>d&&b>e)
{
cout<<b<<endl;//max value
}
elseif (c>a&&c>b&&c>d&&c>e){
cout<<c<<endl;//max value
}
elseif(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.