#include<iostream>
using namespace std;
int main()
{
int a,b,c;
//taking input form user
cout<<"Enter the First number A:";
cin>>a;
cout<<endl;
cout<<"Enter the Second number B:";
cin>>b;
cout<<endl;
cout<<"Enter the Third number C:";
cin>>c;
cout<<endl;
//comparing numbers
if (a>b & a>c)
cout<<"A is largest";
else if(b>a & b>c)
cout<<"B is largest";
else
{ if(c>a & c>b)
{
cout<<"C is largest";
}
else
{ if(a==b & b>c)
cout<<"A & B are largest";
else
{ if(b==c & b>a)
cout<<"B & C are largest";
else
cout<<"A & C are largest";
}
}
}
return 0;
}
using namespace std;
int main()
{
int a,b,c;
//taking input form user
cout<<"Enter the First number A:";
cin>>a;
cout<<endl;
cout<<"Enter the Second number B:";
cin>>b;
cout<<endl;
cout<<"Enter the Third number C:";
cin>>c;
cout<<endl;
//comparing numbers
if (a>b & a>c)
cout<<"A is largest";
else if(b>a & b>c)
cout<<"B is largest";
else
{ if(c>a & c>b)
{
cout<<"C is largest";
}
else
{ if(a==b & b>c)
cout<<"A & B are largest";
else
{ if(b==c & b>a)
cout<<"B & C are largest";
else
cout<<"A & C are largest";
}
}
}
return 0;
}
No comments:
Post a Comment