/* badSwap.c Attempts to swap two integer variables' values by passing the integers into a function. */ #include #include #include void badSwap( int a, int b ); /* functions prototyped or defined before use */ /*........................M A I N F U N C T I O N........................ */ int main() { int x=5,y=10; printf("Before badSwap x: %d, y: %d\n", x,y ); badSwap(x, y); printf("After badSwap x: %d, y: %d\n", x,y ); return 0; } /* BADSWAP */ void badSwap( int a, int b ) { int temp = a; a = b; b = temp; }