I dont know how to make this book exercise that wants me to print out three integers or three strings in numerical/alphabetical order.
I've tried using if statements to solve this but it just fails because im a beginner.
with code like this if(a
cout << a << b << c << endl;
expected results is the numbers i typed in but printed out in numerical order.
#include <iostream>
#include <string>
using namespace std;
int main() {
cout << "Enter three whole numbers" << endl; int a,b,c; cin >> a >> b >> c;
if(a<b<c) {
cout << a << "," << b << "," << c << endl;
}
if(b<a<c) {
cout << b << "," << a << "," << c << endl;
}
if(c<a<b) {
cout << c << "," << a << "," << b << endl;
}
return 0;
}