#include using namespace std; //Pre-declaration of function mySwap. //Proving parameter names is optional here. But data types are required. void mySwap(int & x, int & y); int main() { int a = 10; int b = 20; cout << "Before swap a= " << a << " b=" << b << endl; mySwap(a, b); cout << "After swap a= " << a << " b=" << b << endl; return 0; } void mySwap(int & x, int & y) { int temp; temp = x; //Coke to an empty cup x = y; //Pepsi to Coke's cup y = temp; //Coke to Pepis's cup } //Before swap a= 10 b=20 //After swap a= 20 b=10 //Press any key to continue . . .