/*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();
}

66,875 total views, 10 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.

4,771 Thoughts to “C++ program to print the given numbers in ascending order”

  1. Be both a helpful guide through complex issues plus an informed judge when choices have to be made.

    This will give you sufficient time and employ to brainstorm and be sure what you’re talking about is
    relevant and what you need to make in. To ensure that these
    people will see the message you are looking to get across, write making use of their language and write while
    considering their amount of comprehension.

Leave a Comment