Sunday 15 November 2015

WAP to input three numbers and print them in ascending order.

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d;
clrscr();
printf("enter 3 number");
scanf("%d%d%d",&a,&b,&c);
if(a>b&&b>c)
printf("\n%d\n%d\n%d",a,b,c);
else if(b>c&&c>a)
printf("\n%d\n%d\n%d",b,a,c);
else
printf("\n%d\n%d\n%d",c,a,b);
getch();
}

No comments:

Post a Comment