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