fork download
  1. #include <stdio.h>
  2.  
  3. void swap(int *a, int *b) {
  4. int w;
  5. w=*a;
  6. *a = *b;
  7. *b = w;
  8. }
  9.  
  10. void sort(int *x, int *y) {
  11. if (*x < *y) {
  12. swap(x, y);
  13. }
  14. }
  15.  
  16. int main() {
  17. int x = 3;
  18. int y = 6;
  19. sort(&x, &y);
  20. printf("x = %d, y = %d\n", x, y);
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
x = 6, y = 3