Write a program that prompts the user to enter three integer values, and then outputs the values in numerical secuence separated by commas. So, if the user enters the values 10 4 6, the output should be 4,6,10. If two values are the same, they should just be ordered together. So, the input 4 5 4 should give 4,4,5.
Now I have know idea how to do this smartly (just few lines of code) but I have experimented sorting each case separately. Is there an operator for and? I have used the & operator which means or.
You have use && operator which means and. Like "left hand condition and right hand condition must be true for expression to be true".
There is logical or operator: || (or or if you wish)
Yep, that might be true but I haven`t touched the code at all. I don`t think I need the or-statement at all if I can cover all the possibilities with and-statements.
10 4 6 doesn't fit any of the conditions you've defined so far.
With three numbers, it's not that bad to figure out all the possible sequences they could be in, but with a larger set of numbers, I'd want to use some sort of sorting algorithm.
If you were going to sort the numbers into low to high order, they could be in order different ways.
abc, acb, bac, bca, cab, cba
OT - but when you include a file at the top of the program, you're essentially cutting and pasting the contents of that file into your program, so if you include files you don't need, you're making your program bigger than it has to be.