Oct 17, 2020 05:08 AM
(This post was last modified: Oct 17, 2020 05:08 AM by dawid17.)
So I got this code, I input three numbers. Now I want to display them in a for loop. From smallest to biggest, and in another loop from biggest to smallest. How can I do this?
I have done this like this but I think it's not a proper way to do it?
Code
int main() {
int num1, num2, num3;
cout << "Enter first num" << endl;
cin >> num1;
cout << "Enter second num" << endl;
cin >> num2;
cout << "Enter third num" << endl;
cin >> num3;I have done this like this but I think it's not a proper way to do it?
Code
for(int i=0; i<=0; i++) {
cout << num1 << num2 << num3;
}
for(int i=0; i<=0; i++) {
cout << num3 << num2 << num1;
}
