#include using namespace std; void order(int & x, int & y) { if (x > y) { int t = x; x = y; y = t; } } int main() { int a, b, c; cout << "enter the values "; cin >> a >> b >> c; order(a, b); order(b, c); // biggest gets into C, but A, B messed up order(a, b); // so fix them cout << "sorted = " << a << ", " << b << ", " << c << "\n"; }