Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- void main()
- {int a,b,c;
- clrscr();
- printf("Enter three unequal integers");
- scanf(" %d %d %d", &a,&b,&c);
- if (a==b||b==c||c==a)//1. what i did was i added a comma here. so unexpected else bol raha tha
- printf("Error");
- else//1
- { if(a>b)//2
- { if(c>a)//3
- printf("The descending order is \n%d \n%d \n%d ",c,a,b);
- else//3
- { if(c>b)//4
- printf("The Descending order is \n%d \n%d \n%d",a,c,b);
- else//4
- printf("The Descending order is \n%d \n%d \n%d",a,b,c);}}
- else//2
- { if(c>b)//5
- printf("The Descending order is \n%d \n%d \n%d",c,b,a);
- else//5
- { if(c>a)//6
- printf("The Descending order is \n%d \n%d \n%d",b,c,a);
- else//6
- printf("The descending order is \n%d \n%d \n%d ",b,a,c);}}
- getch();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement