#include< stdio.h > void swap_by_value(int x,int y) { int m=x; x=y y=m; } void swap_by_reference(int *x,int *y) { int m=*x; *x=*y; *y=m; } void main() { int a=20,b=30; printf("a=%d b=%d before function call \n",a,b); swap_by_value(a,b); printf("a=%d b=%d after call by value function call\n",a,b); swap_by_reference(&a,&b) ; printf("a=%d b=%d after call by reference function call\n",a,b); }