- #1
Hacker Jack
- 10
- 14
- TL;DR Summary
- Write a program that takes 3 integer inputs and orders them in ascending order (accounting for same numbers)
Do you consider writing a program that takes 3 integer inputs and orders them in ascending order (accounting for same numbers) difficult?
You can only use if statements (if, else if, else). I know there is some thing called "sort" that does the tedious work for you but do you find this simple task kind of hard, at least for someone who doesn't have much of a math background and is a beginner programmer.
If you find it easy, write the program down in your preferred language (I would prefer you do it in C++ as that is what I am learning).
It is an exercise from the book "Programming principles and practice using C++" by Bjarne Stroustrup who is the creator of C++. Mixed reviews on the book by others. I found the book by Tony Gaddis "Starting out with C++ from control structures to Objects" and have skimmed through the pages and seems to do better at explaining and simplifying stuff for newbies like me much better.
You can only use if statements (if, else if, else). I know there is some thing called "sort" that does the tedious work for you but do you find this simple task kind of hard, at least for someone who doesn't have much of a math background and is a beginner programmer.
If you find it easy, write the program down in your preferred language (I would prefer you do it in C++ as that is what I am learning).
It is an exercise from the book "Programming principles and practice using C++" by Bjarne Stroustrup who is the creator of C++. Mixed reviews on the book by others. I found the book by Tony Gaddis "Starting out with C++ from control structures to Objects" and have skimmed through the pages and seems to do better at explaining and simplifying stuff for newbies like me much better.