#include<iostream.h>
void main()
{
int a, b, c;
cout<<"ENTER THE FIRST NUMBER : ";
cin>>a;
cout<<"ENTER THE SECOND NUMBER : ";
cin>>b;
cout<<"ENTER THE THIRD NUMBER : ";
cin>>c;
if(a>b && a>c && b>c)
{
cout<<a<<" IS GREATEST."<<endl;
cout<<b<<" IS SECOND GREATEST."<<endl;
cout<<c<<" IS LEAST.";
}
else if(a>b && a>c && c>b)
{
cout<<a<<" IS GREATEST."<<endl;
cout<<c<<" IS SECOND GREATEST."<<endl;
cout<<b<<" IS LEAST.";
}
else if(b>a && b>c && a>c)
{
cout<<b<<" IS GREATEST."<<endl;
cout<<a<<" IS SECOND GREATEST."<<endl;
cout<<c<<" IS LEAST.";
}
else if(a>b && a>c && c>a)
{
cout<<b<<" IS GREATEST."<<endl;
cout<<c<<" IS SECOND GREATEST."<<endl;
cout<<a<<" IS LEAST.";
}
else if(c>a && c>b && b>a)
{
cout<<c<<" IS GREATEST."<<endl;
cout<<b<<" IS SECOND GREATEST."<<endl;
cout<<a<<" IS LEAST.";
}
else if(c>a && c>b && a>b)
{
cout<<c<<" IS GREATEST."<<endl;
cout<<a<<" IS SECOND GREATEST."<<endl;
cout<<b<<" IS LEAST.";
}
else
cout<<"INVALID INPUT.";
}
No comments:
Post a Comment