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

50,103 total views, 26 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.

3,421 Thoughts to “C++ program to print the given numbers in ascending order”

  1. fantastic points altogether, you just received a new reader. What may you recommend about your post that you made a few days ago? Any sure?

Leave a Comment