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