FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 71   



Following program shows you how to find largest number from given 3 numbers.
In this program we get inputs from user and shows largest number from given three numbers using if condition

number1 = int(input("Enter first number: "))
number2 = int(input("Enter second number: "))
number3 = int(input("Enter third number: "))
if (number1 == number2) and (number1 == number3):
    print("All numbers are equal")
elif (number1 > number2) and (number1 > number3):
    print(number1, " is larger than ", number2, " and ", number3)
elif (number2 > number1) and (number2 > number3):
    print(number2, " is larger than ", number1, " and ", number3)
elif (number3 > number1) and (number3 > number2):
    print
    (number3, " is larger than ", number2, " and ", number1)

Output:

Example1:

Enter first number:  2
Enter second number:  2
Enter third number:  2
All numbers are equal

Example2:

Enter first number:  25
Enter second number:  75
Enter third number:  33
75  is larger than  25  and  33



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News