Advertisement
kkricardokaka95

Untitled

Jan 26th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.79 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {int a,b,c;
  5. clrscr();
  6. printf("Enter three unequal integers");
  7. scanf(" %d %d %d", &a,&b,&c);
  8. if (a==b||b==c||c==a)//1. what i did was i added a comma here. so unexpected else bol raha tha
  9. printf("Error");
  10. else//1
  11. {    if(a>b)//2
  12.       { if(c>a)//3
  13.      printf("The descending order is \n%d \n%d \n%d ",c,a,b);
  14.        else//3
  15.     { if(c>b)//4
  16.        printf("The Descending order is \n%d \n%d \n%d",a,c,b);
  17.      else//4
  18.          printf("The Descending order is \n%d \n%d \n%d",a,b,c);}}
  19.      else//2
  20.     { if(c>b)//5
  21.        printf("The Descending order is \n%d \n%d \n%d",c,b,a);
  22.      else//5
  23.       { if(c>a)//6
  24.        printf("The Descending order is \n%d \n%d \n%d",b,c,a);
  25.        else//6
  26.        printf("The descending order is \n%d \n%d \n%d ",b,a,c);}}
  27.  
  28. getch();
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement