Python program to print the largest number


Write a program in python to print the largest number

---------------------------------------------
n1=int(input("Enter the first number : "))
n2=int(input("Enter the second number : "))
n3=int(input("Enter the third number : "))
max=n1
if n2>max:
 max=n2
if n3>max:
 max=n3
print("Largest number is : ",max)
---------------------------------------------
Output 1-

Enter the first number : 50
Enter the second number : 40
Enter the third number : 60
Largest number is :  60

Output 2-

Enter the first number : 50
Enter the second number : 40
Enter the third number : 30
Largest number is :  50

Output 3-

Enter the first number : 20
Enter the second number : 40
Enter the third number : 10
Largest number is :  40

Post a Comment

0 Comments