Python Program to find Biggest of Three Numbers

Last Updated:

Find Biggest of Three Numbers

In the following example, we will find which of the following numbers (40, 25, 7) is the biggest number.

Example

Python Compiler
import math a = 40; b = 25; c = 7; print("The numbers are a = %d, b = %d, c = %d " % (a, b, c)); if(a > b and a > c): print("a = %d is the biggest number" % a) elif(b > c): print("b = %d is the biggest number" % b) else: print("c = %d is the biggest number" % c)

Find Biggest of any Given Three Numbers

In the following example, we will find the biggest of any given three numbers.

Example

Python Compiler
a = int(input("Enter an integer for a = ")); b = int(input("Enter an integer for b = ")); c = int(input("Enter an integer for c = ")); if(a > b and a > c): print("\na = %d is the biggest number" % a) elif(b > c): print("\nb = %d is the biggest number" % b) else: print("\nc = %d is the biggest number" % c)

Share this Page

Meet the Author