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