Write a program to input a 3 digit number (using function parameter) and print whether the sum of the first and last digit is an even number or not.
Answers
Answered by
1
Explanation:
#program to input a 3 digit number
num=int(input("enter 3digit value::")
flag=0
n=num
sum=0
while n>0:
flag=num%10
num=num//100
sum=sum+flag
if sum%2=0:
print ("the number is even")
else:
print("the number is odd")
Sry i dont know about function parameter.
but this may help you..
Similar questions
Math,
3 months ago
English,
6 months ago
Math,
6 months ago
French,
10 months ago
Political Science,
10 months ago