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

Program Coding

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


OUTPUT 


























No comments:

Post a Comment

Total Pageviews