Question: Write a program that sorts three given numbers from smallest to largest. a . Ask the user to input three numbers, one at a time,
Write a program that sorts three given numbers from smallest to largest.
a Ask the user to input three numbers, one at a time, and save the numbers to a list.Hint: you need to create an empty list first.
b Your program refers to each number using index and do the comparisons. Use nested conditions, not loops or sorting functions. How many comparisons do we need to decide the order of three numbers? For instance, first layer to compare theList and theList what to compare in the second layer? Is there a third layer?
Example: input one at a time
output
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
