Software & Finance





Python - Biggest of 3 given numbers





 

Here is the python program to find the biggest of 3 given numbers. This code is tested with Python version 2.6

 

        print "Program to find biggest of three numbers"
        a = 0
        b = 0
        c = 0
        print "Enter First Number:",
        a = input()
        print "Enter Second Number:",
        b = input()
        print "Enter Third Number:",
        c = input()
        
        big = c
        if (a > b and a > c):
           big = a
        elif(b > c):
           big = b
        
        print "Biggest of (", a, ",", b, ",", c, ") is: ", big
        
        
        #sample output
        #Program to find biggest of three numbers
        #Enter First Number: 10
        #Enter Second Number: 20
        #Enter Third Number: 30
        #Biggest of ( 10 , 20 , 30 ) is:  30