Make a program that take three integers and show the result in the ascending Order.

PROGRAM CODE

#include <iostream>
using namespace std;
int main()
{
 int a,b,c;
 cout<<"Enter first Integer: ";
 cin>>a;
 cout<<"Enter Second Integer: ";
 cin>>b;
 cout<<"Enter Third Integer: ";
 cin>>c;
 if ((a>b)&&(b>c))
 {
 cout<<"The Ascedning order is"<<endl;
 cout<<c<<endl;
 cout<<b<<endl;
 cout<<a<<endl;}
 else if ((a<b)&&(b>c)&&(a>c))
    {
     cout<<"The Ascending order is"<<endl;
     cout<<c<<endl;
     cout<<a<<endl;
     cout<<b<<endl;
    }
 else if ((a<b)&&(b<c))
 {
 cout<<"The Ascending order is "<<endl;
 cout<<a<<endl;
 cout<<b<<endl;
 cout<<c<<endl;
}
    else if ((a>b)&&(a<c))
 {
 cout<<"The Ascending order is"<<endl;
 cout<<b<<endl;
 cout<<a<<endl;
 cout<<c<<endl;}
 else if ((a>b)&&(b<c))
 { cout<<" The Ascending Order Is"<<endl;
 cout<<b<<endl;
 cout<<c<<endl;
 cout<<a<<endl;
   }
   else if((a<b)&&(a<c))
   { cout<<" The Ascending Order Is"<<endl;
   cout<<a<<endl;
   cout<<c<<endl;
   cout<<b<<endl;}}

RESULT

Comments