0% found this document useful (0 votes)
4 views1 page

Find Largest of Three Numbers Program

The document outlines a program aimed at finding the largest of three numbers input by the user. It includes a step-by-step algorithm and a sample Python code implementation. The program compares the three numbers and prints the greatest one based on the comparisons.

Uploaded by

irfanyounuspj14
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Find Largest of Three Numbers Program

The document outlines a program aimed at finding the largest of three numbers input by the user. It includes a step-by-step algorithm and a sample Python code implementation. The program compares the three numbers and prints the greatest one based on the comparisons.

Uploaded by

irfanyounuspj14
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Program 3

Program to find the largest of three numbers

Aim
Write a program to find the largest of three numbers

Algorithm
[Link]

[Link] first number and store it in variable num1.

[Link] second number and store it in variable num2.

[Link] third number and store it in variable num3.

[Link] the numbers:

[Link] num1 >= num2 and num1 >= num3


→ Print "num1 is the greatest".

[Link] if num2 >= num1 and num2 >= num3


→ Print "num2 is the greatest".

[Link]
→ Print "num3 is the greatest".

9. Stop

Program
num1 = int(input("Enter 1st number: "))
num2 = int(input("Enter 2nd number: "))
num3 = int(input("Enter 3rd number: "))
if (num1 >= num2) and (num1 >= num3):
print(num1, ” is the greatest")
elif (num2 >= num1) and (num2 >= num3):
print(num2, ” is the greatest")
else:
print(num3, “ is the greatest")

Sample Output
Enter 1st number: 6764
Enter 2nd number: 123
Enter 3rd number: 57
6764 is the greatest

You might also like