#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, d; cout << "enter the values "; cin >> a >> b >> c >> d; order(a, b); order(b, c); order(c, d); // d is biggest order(a, b); order(b, c); order(a, b); cout << "sorted = " << a << ", " << b << ", " << c << ", " << d << "\n"; }