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