Question: C++ : Function 1) Write a C++ function that swaps two numbers. Show how the function will be called from main0. Hint: Think if this
C++ : Function

1) Write a C++ function that swaps two numbers. Show how the function will be called from main0. Hint: Think if this function needs its parameters to be passed by value or reference. Think of the return type of the function. Note that the function needs to be returning two things as in if variable x had the integer 5 and variable y had integer 7 initially, after calling the swap function, variable x in mainO will have the integer 7 and variable y in main) will have the integer 5. [5]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
