#include <iostream>
#include <string>
using namespace std;
int main()
{
double a=0; //initializes a
double b=0; //initializes b
double c=0; //initializes c
cout<<"Enter the first number";
cin>>a;
cout<<"Enter the second number";
cin>>b;
cout<<"Enter the third number";
cin>>c;
cout<<"The average of these values is "<<(a+b+c)/3<<endl;
if ((a>b) && (a>c));
{
cout<<a<<"is the largest double"<<endl;
}
if ((b>a) && (b>c));
{
cout<<b<<"is the largest double"<<endl;
}
if ((c>a) && (c>b));
{
cout<<c<<"is the largest double"<<endl;
}
if ((a<b) && (a<c));
{
cout<<a<<"is the smallest double"<<endl;
}
if ((b<a) && (b<c));
{
cout<<b<<"is the smallest double"<<endl;
}
if ((c<a) && (c<b));
{
cout<<c<<"is the smallest double"<<endl;
}
system("pause");
}
This is supposed to print the max of these doubles and the minimum of these doubles, but instead it just prints all of them.
Why doesn't my code do what its supposed to do?
-- Sat Jan 31, 2009 11:21 pm --
oh crap it took all out my tabbing.
ok guys pretend there's nothing wrong with the tabbing when you look at it.

