#include <iostream>
usingnamespace std;
int main()
{
double maxVal = 0,
minVal = 0,
average = 0.0,
finalVal = 6,
test = 0,
counter,
num = 0;
cout<<"Enter six numbers: ";
cin>>num;
maxVal = num;
minVal = num;
average+=num;
for(counter = 1; counter < finalVal; counter++)
{
cout<<": ";
cin>>num;
if(num < minVal)
{
minVal = num;
}
if(num > maxVal)
{
maxVal = num;
}
average+=num;
}
average/=finalVal;
cout<<"\nMax Value is: "<<maxVal;
cout<<"\nMininum Value is: "<<minVal;
cout<<"\nAverage is: "<<average;
return 0;
}
I just want to know if there is anything amateurish about it, something that can be done better or less "messy" using ONLY if and loops, currently my class is in the "if" and "loop" chapters so I can't really use very advanced things (if there are any applicable).