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