Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1.  
  2. int main()
  3. {
  4.     int a = 67, b = 10, c = 98;
  5.     printf("a = %d, b = %d, c = %d\n", a, b, c);
  6.  
  7.         if (a > b) {
  8.             if (b > c) {
  9.                 int temp = a;
  10.                 a = c;
  11.                 c = temp;
  12.             }
  13.             else {
  14.                 if (a > c) {
  15.                     int temp = a;
  16.                     a = b;
  17.                     b = c;
  18.                     c = temp;
  19.                 }
  20.                 else {
  21.                     int temp = a;
  22.                     a = b;
  23.                     b = temp;
  24.                 }
  25.             }
  26.         }
  27.         else{
  28.             if (a > c){
  29.                 int temp = a;
  30.                 a = c;
  31.                 c = b;
  32.                 b = temp;
  33.             }
  34.         else {
  35.             if (b > c) {
  36.                 int temp = b;
  37.                 b = c;
  38.                 c = temp;
  39.             }
  40.  
  41.         }
  42.     }
  43.     printf("a=%d, b=%d, c=%d\n", a, b, c);
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement