Given a number N, print the even factors of N.If the even factor does not exists for N print'-1'.
Input Format
Answers
Answered by
3
Answer: x = int(input("Enter any number \n"))
print("The factors of",x,"are:")
for i in range(1, x + 1):
if x % i == 0:
if i % 2 == 0:
print(i," Even")
else:
print(i," Odd")
Answered by
2
Given a number N, print the even factors of N, If the even factor does not exists for N:
Explanation:
- x = int(input("Enter any number \n"))
- print("The factors of", x ,"are:")
- for i in range(1, x + 1):
- if x % i == 0:
- if i % 2 == 0:
- print(i," Even")
- else:
- print(i," Odd")
Similar questions