c program to arrange 3- numbers in ascending order without using array.

c program to arrange three numbers in ascending order without using array. or

Ascending order program in c-language using if-else.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,n,m,p;
clrscr();
printf("Enter the three number \n");
scanf("%d%d%d",&a,&b,&c);
if(a<b&&a<c&&b<c)
{
n=a;
m=b;
p=c;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a>b&&a>c&&b>c)
{
n=c;
m=b;
p=a;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a>b&&a>c&&b<c)
{
n=b;
m=c;
p=a;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a<b&&a>c&&b>c)
{
n=c;
m=a;
p=b;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a<b&&a<c&&b>c)
{
n=a;
m=c;
p=b;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a>b&&a<c&&b<c)
{
n=b;
m=a;
p=c;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a==b&&b<c)
{
n=a;
m=b;
p=c;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a==c&&b<c)
{
n=b;
m=a;
p=c;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a==c&&b>c)
{
n=a;
m=c;
p=b;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a<b&&b==c)
{
n=a;
m=b;
p=c;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a>b&&b==c)
{
n=b;
m=c;
p=a;
printf("Ascending order is= %d %d %d",n,m,p);
}
else if(a==b&&b>c)
{
n=c;
m=b;
p=a;
printf("Ascending order is= %d %d %d",n,m,p);
}
getch();
}

 c program to sort an array in descending order,c program to arrange numbers in ascending order without using array,c program for sorting numbers in ascending and descending order,c program to sort n numbers in ascending order,arrange the digits of a number in ascending order in c,ascending order program in c using if-else,ascending order in c without using array,c program to sort 2d array in ascending order,Programming 5 axis cnc,java web services rest,java spring tutorial,java rest api,java point,java virtual machine,java executor framework,java for windows 7,restful  web services java,java web services soap,java 8 download,programming game ai by example,programming questions in java,programming quotes,programming for problem solving,programming with mosh,programming near me,programming in visual basic,programming python pdf,programming r,programming aptitude test,

ascending order program ,output


Program in c language using if-else condition.

Post a Comment

0 Comments