#include using namespace std; void swapif(int & x, int & y) { if (x > y) { int temp = x; x = y; y = temp; } } int main() { int a, b, c, d; cout << "Enter the numbers: "; cin >> a >> b >> c >> d; swapif(a, b); swapif(b, c); swapif(c, d); swapif(a, b); swapif(b, c); swapif(a, b); cout << "In order, they are :\n"; cout << a << "\n"; cout << b << "\n"; cout << c << "\n"; cout << d << "\n"; }