CBSE 11TH CLASS CS PROGRAM 3

 

3. Input three numbers and display the largest/smallest number.

Python

num1 = int(input("Enter the first number: "))

num2 = int(input("Enter the second number: "))

num3 = int(input("Enter the third number: "))

 

largest = max(num1, num2, num3)

smallest = min(num1, num2, num3)

 

print("Largest number:", largest)

print("Smallest number:", smallest)

No comments:

Post a Comment