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 *a, int *b){
  11. if(*a<*b){
  12. swap(a,b);
  13. }
  14. }
  15.  
  16. int main(void) {
  17. int x=56;
  18. int y=13;
  19. printf("x = %d, y = %d\n",x,y);
  20. sort(&x,&y);
  21. printf("x = %d, y = %d",x,y);
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
x = 56, y = 13
x = 56, y = 13