Program to Find the maximum of 3 numbers in python

Posted by

In this Post you will learn how to write a program in Python to find largest of three numbers.

How our program will behave?

Suppose if someone give 3 numbers as input 12, 2 and 45 then our program should return 45 as a output because 45 is a greatest among three.

n1 = int(input("please give first number n1: "))
n2 = int(input("please give second number n2: "))
n3 = int(input("please give third number n3: "))
if n1>=n2 and n1>=n3: 
	print(" n1 is greatest");
if n2>=n1 and n2>=n3:
	print(" n2 is greatest");
if n3>=n1 and n3>=n2:
	print("n3 is greatest"); 

output

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *