Design a program that asks user to enter any three numbers. The program should display the three numbers in ascending order. using python code please
n1 = float(input("Enter first number: ")) n2 = float(input("Enter second number: ")) n3 = float(input("Enter third number: ")) if n1 <= n2 <= n3: print("numbers in sorted order is", n1, n2, n3) elif n1 <= n3 <= n2: print("numbers in sorted order is", n1, n3, n2) elif n2 <= n1 <= n3: print("numbers in sorted order is", n2, n1, n3) elif n2 <= n3 <= n1: print("numbers in sorted order is", n2, n3, n1) elif n3 <= n1 <= n2: print("numbers in sorted order is", n3, n1, n2) else: print("numbers in sorted order is", n3, n2, n1)
Get Answers For Free
Most questions answered within 1 hours.