/*C++ program to print the given numbers in ascending order*/

#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
cout<<“enter the values of a,b,c”;
cin>>a>>b>>c;
if(a<b&&a<c)
{
if(b<c)
{
cout<<a<<” “<<c<<” “<<b;
}
else
{
cout<<a<<” “<<c<<” “<<b;
}
}
else if(b<c)
{
if(a<c)
{
cout<<b<<” “<<a<<” “<<c;
}
else
{
cout<<b<<” “<<c<<” “<<a;
}
}
else
{
if(a<b)
{
cout<<c<<” “<<a<<” “<<b;
}
else
{
cout<<c<<” “<<b<<” “<<a;
}
}
getch();
}

26,377 total views, 90 views today

Get Free Email Updates..!
Join us for FREE to get instant email updates..! GobsInfo- Everything Unlimited
We hate spam. Your email address will not be sold or shared with anyone else.

1,768 Thoughts to “C++ program to print the given numbers in ascending order”

  1. This web site is really a stroll-through for all the info you wanted about this and didn’t know who to ask. Glimpse here, and also you’ll positively discover it.
    barbour outlet maine http://www.appanageinvestments.com/barbour/

Leave a Comment