#include using namespace std; void swapv(int x, int y) { int temp = x; x = y; y = temp; } void swapp(int *px, int *py) { int temp = *px; *px = *py; *py = temp; } void swapr(int & x, int & y) { int temp = x; x = y; y = temp; } int main() { int a = 13, b = 7; int *pa = &a, *pb = &b; cout << "a=" << a << ", b=" << b << endl; cout << "Calling swapv" << endl; swapv(a, b); cout << "a=" << a << ", b=" << b << endl; cout << "Calling swapp" << endl; swapp(&a, &b); cout << "a=" << a << ", b=" << b << endl; cout << "Calling swapr" << endl; swapr(a, b); cout << "a=" << a << ", b=" << b << endl; }