Dremendo Tag Line

Calculate product and check last digit even or odd in Python

if else - Question 9

In this question, we will see how to input 3 numbers and check if the product of their last digit is even or odd in Python programming using the if else statement. To know more about if else statement click on the if else statement lesson.

Q9) Write a program in Python to input 3 numbers and check if the product of their last digit is even or odd.

Program

print('Enter 3 numbers')
a=int(input())
b=int(input())
c=int(input())
s=(a%10)*(b%10)*(c%10)

if s%2==0:
    print('Product of their last digit is even')
else:
    print('Product of their last digit is odd')

Output

Enter 3 numbers
18
32
46
Product of their last digit is even
video-poster