Computer Science, asked by AbdulHafeezAhmed, 6 months ago

❌ No spam or rubbish answers ❌ Write a code in Python to find the largest number among three numbers

Answers

Answered by suhrutha21
6

# Python program to find the largest number among the three input numbers

# take three numbers from user

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

Answered by ThePrincesss
15

✧༺♥༻✧✧༺♥༻✧✧

# Python program to find the largest number among the three input numbers.

# take three numbers from user.

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

✧༺♥༻✧✧༺♥༻✧

Similar questions