Write a program to accept user’s input and print the greater of the two numbers
Share
Write a program to accept user’s input and print the greater of the two numbers
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
Program to find the greatest of two numbers and greatest of three numbers is discussed here. Input two or integers from the user and find the greatest number among them.
Input & Output format:
Input consists of 2 integers.
Sample Input and Output :
7
9
5
9 is greater.
Explanation:
numbers = input("Enter 2 numbers: ").split()
ints = [int(num) for num in numbers]
print(max(ints))