Answer on Question #38707 - Programming - C++
Below is the code of the required program in C++:
#include <iostream>
using namespace std;
int main() {
int a, b, c, temp;
cout << "Enter three numbers: ";
cin >> a >> b >> c;
if (a < b) {
temp = a;
a = b;
b = temp;
}
if (a < c) {
temp = a;
a = c;
c = temp;
}
if (b < c) {
temp = b;
b = c;
c = temp;
}
cout << "In order they are: " << a << " " << b << " " << c << endl;
return 0;
}
Comments