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