ramontricolor12

LISTA 02 - exercicio 38

May 27th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int num1, num2, num3, aux;
  6.     printf("\nInforme tres numeros: ");
  7.     scanf("%d %d %d", &num1, &num2, &num3);
  8.  
  9.     if(num1 > num2)
  10.     {
  11.         aux = num1;
  12.         num1 = num2;
  13.         num2 = aux;
  14.     }
  15.     if(num2 > num3)
  16.     {
  17.         aux = num2;
  18.         num2 = num3;
  19.         num3 = aux;
  20.     }
  21.     if(num1 > num2)
  22.     {
  23.         aux = num1;
  24.         num1 = num2;
  25.         num2 = aux;
  26.     }
  27.     printf("%d %d %d", num1, num2, num3);
  28.  
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment