codemaniacstudio

Write a Python program to find maximum between three numbers.

Write a Python program to find maximum between three numbers.

PROGRAM

# Program to find the maximum between three numbers

# Take input from the user
num1 = float(input(“Enter the first number: “))
num2 = float(input(“Enter the second number: “))
num3 = float(input(“Enter the third number: “))

# Compare the numbers
if num1 >= num2 and num1 >= num3:
print(f”The maximum number is: {num1}”)
elif num2 >= num1 and num2 >= num3:
print(f”The maximum number is: {num2}”)
else:
print(f”The maximum number is: {num3}”)

OUTPUT

TRY THE ABOVE CODE

Exit mobile version