Question: Answer this question using C++ 2. (Swap functions) (60 points) Write two overloaded functions named sawpnum that is used to swap two integers without using

Answer this question using C++
2. (Swap functions) (60 points) Write two overloaded functions named sawpnum that is used to swap two integers without using temporary variables. Demonstrate the functions in your program. a). (30 points) Using pointers: the function takes pointers to two integer variables as parameters and swaps the contents in the variables using pointers and without creating any extra variables or pointers. Your function prototype is as follows. void swapnum (int *, int *) b). (30 points) Using reference variables: the function takes references parameters to the two integer variables and swaps the contents in the variables without creating any extra variables. Your function prototype 1s void swapnum (i t &, int &)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
