/* ptrSwap.c */ #include #include #include /*........................M A I N F U N C T I O N........................ */ int main() { int x=5,y=10, temp; int *px = &x; int *py = &y; printf("Before swap: x: %d, y: %d\n", x,y ); /* classical swap operation */ temp = *px; *px=*py; *py = temp; printf("After swap: x:%d, y: %d\n", x,y ); return 0; }