Write two functions that swap the values of two integers in different ways:
void swapPtr(int* a, int* b)
void swapRef(int& a, int& b)
The program will call both functions and print the results. You only need to implement the two functions.
Example Input:
5 10
Output:
After swapPtr: a=10 b=5 After swapRef: a=10 b=5
Input:
-3 7
After swapPtr: a=7 b=-3 After swapRef: a=7 b=-3
Test Cases
Test Results
Input
Expected Output