Q.1 a) Write a python program to accept three numbers from the user and print the
largest amongst them.
b) Check the largest number if it is odd or even.
Answers
Answered by
0
Answer:
n1 = int(input('Enter 1st number: '))
n2 = int(input('Enter 2nd number: '))
n3 = int(input('Enter 3rd number: '))
greatest = None
if (n1>n2) and (n1>n3):
greatest = n1
elif (n2>n1) and (n2>n3):
greatest = n2
elif (n3>n2) and (n3>n1):
greatest = n3
print(' Greatest number is:', greatest)
if (greatest%2==0):
print(greatest,'is an Even number')
else:
print(greatest,'is an odd number')
Similar questions
Social Sciences,
2 months ago
Social Sciences,
2 months ago
Science,
5 months ago
Chemistry,
11 months ago