#include using namespace std; void order(int & x, int & y) /* ampersand before variable name means it is a reference parameter. not a copy of the original value, but a redirection to the original variable */ { cout << "2 x = " << x << "\n"; cout << "2 y = " << y << "\n"; if (x > y) { int t = x; cout << "swapping\n"; x = y; y = t; } cout << "3 x = " << x << "\n"; cout << "3 y = " << y << "\n"; } int main() { int a, b; cout << "enter the values "; cin >> a >> b; cout << "1 a = " << a << "\n"; cout << "1 b = " << b << "\n"; order(a, b); cout << "4 a = " << a << "\n"; cout << "4 b = " << b << "\n"; }