codemaniacstudio

Write a Python program to find maximum between two numbers.

Write a Python program to find maximum between two numbers.

PROGRAM

# Program to find the maximum between two numbers

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

# Compare the numbers
if num1 > num2:
print(f”The maximum number is: {num1}”)
elif num2 > num1:
print(f”The maximum number is: {num2}”)
else:
print(“Both numbers are equal.”)

OUTPUT

TRY THE ABOVE CODE

Exit mobile version