Question: Write a program that reads three numbers and print the numbers in sorted order. For example, if the number reads are 3 , 1 ,

Write a program that reads three numbers and print the numbers in sorted order. For example, if the number reads are 3,1, and 2, then it prints 1,2,3. If the numbers are 1,1,1, then the sorted order is 1,1,1.Suppose that the numbers are stored with the variables a,b, and c. Then below possible sorted order of a, b, and c depending on their values. 1. a,b,c2. a,c,b3. b,a,c4. b,c,a5. c,a,b6. c,b,aFor example, if a is 3, b is 1 and c is 2, then the sorted order would be b,c,a. This means b is the smallest, follows by c and a is the largest. Hint: it is easier if you use compound Boolean expressions instead of nested if statements.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!