Help with C++ programming?

So i have an assignment of asking the user for five positive integers and then declaring the max, min, geometric mean, and the arithmetic mean of the user's number.

I have compiled the program so far;

# include <iostream>
# include <cmath>
# include <string>
using namespace std;//
int main ( ) {

double a,b,c,d,e;
double max = 0;
double min = 0;

cout<<"Enter 5 positive integers: "<<a<<b<<c<<d<<e<<endl;
cin>>a>>b>>c>>d>>e;

if (a>b && a>c && a>d && a>e)
{max = a;}
if (b>c && b>d && b>e && b>a)
{max = b;}
if (c>a && c>b && c>d && c>e)
{max = c;}
if (d>a && d>b && d>c && d>e)
{max = d;}
if (e>a && e>b && e>c && e>d)
{max = e;}

cout<<"Biggest Number is: "<<max<<endl;
if (a<b && a<c && a<d && a<e)
{min = a;}
if (b<c && b<d && b<e && b<a)
{min = b;}
if (c<a && c<b && c<d && c<e)
{min = c;}
if (d<a && d<b && d<c && d<e)
{min = d;}
if (e<a && e<b && e<c && e<d)
{min = e;}
double k=a*b*c*d*e;
cout<<"Smallest Number is: "<<min<<endl;
cout<<"Arithmetic mean: "<<(a+b+c+d+e)/5<<endl;
cout<<"Geometric mean: "<<pow(k,0.2)<<endl;
cout<<"Harmonic mean: "<<5/((1/a)+(1/b)+(1/c)+(1/d)+(1/e));
return 0;

}





However when i try to run it, it compiles on jGrasp, and on Codepad.org, but on my college blackboard account; it gives me a 0 because it is incorrect. Any suggestions?
Hi safatchowdhury, it will be good if you put your code in between the code tage (<>).

The problem with your code is:
cout<<"Enter 5 positive integers: "<<a<<b<<c<<d<<e<<endl;

The correct way should be:
cout<<"Enter 5 positive integers: ";
Topic archived. No new replies allowed.