how to output numbers in ascending orders..

Hi, im new to C++. Can anyone teach me how to output numbers in ascending order after input 3 numbers?
Can i use the if statement to do it?
how to do it?
Thanks.
Sure, when you are processing only 3 numbers, thats no big problem. But if you are going to expand the program, you're gonna have to type a lot of if/else-statments. Then you should use a list

http://www.cplusplus.com/reference/stl/list

lists have got the function sort() that will do the work for you. If you want to create your own sorting algorithm:

http://en.wikipedia.org/wiki/Sorting_algorithm
Topic archived. No new replies allowed.