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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!