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