Computer Science, asked by khushigautam21sep, 11 months ago

write a python programe to find the maximum value between three given number​

Answers

Answered by arpitparihar02
3

num1 = float(input("Enter first number: "))

num2 = float(input("Enter second number: "))

num3 = float(input("Enter third number: "))

if (num1 > num2) and (num1 > num3):

largest = num1

elif (num2 > num1) and (num2 > num3):

largest = num2

else:

largest = num3

print("The largest number is",largest)

Output 1:

Enter first number: 10

Enter second number: 12

Enter third number: 14

The largest number is 14.0

Output 2:

Enter first number: -1

Enter second number: 0

Enter third number: -3

The largest number is 0.0

Explanation:

In this program, we ask the user to input three numbers. We use the if…elif…else ladder to find the largest among the three and display it.

Similar questions