write a program to accept two numbers from users input and print the greater of two numbers
Answers
Answered by
0
Answer:
Using Built-In Function
Algorithm to print the greatest of two numbers using the built-in function
Step 1: Get 2 inputs from the user
Step 2: Find the greatest of two numbers using the built-in function 'max'
Step 3: Print the output
Step 5: End
Python program to print the greatest of two numbers using the built-in function
# Python program to find the greatest of two numbers using the built-in function
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
print(max(num1, num2), "is greater")
Input:
Enter the first number: 23
Enter the second number: 45
Output:
45 is greater
Similar questions