fork(5) download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a, b, c;
  5. printf("Digite 3 numeros:\n");
  6. scanf("%d %d %d", &a, &b, &c);
  7. if (a > c) {
  8. int tmp = c;
  9. c = a;
  10. a = tmp;
  11. }
  12. if (a > b) {
  13. int tmp = b;
  14. b = a;
  15. a = tmp;
  16. }
  17. if (b > c) {
  18. int tmp = c;
  19. c = b;
  20. b = tmp;
  21. }
  22. printf("%d %d %d", a, b, c);
  23. }
  24.  
  25. //https://pt.stackoverflow.com/q/190931/101
Success #stdin #stdout 0s 4328KB
stdin
5
2
3
stdout
Digite 3 numeros:
2 3 5