Computer Science, asked by bhargavi2019leece, 4 months ago

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 himanshujol2677
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 priyarksynergy
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