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