wap to input a number, count the number of odd factors and print it
Answers
Answered by
1
Answer:
Only those numbers, which are perfect Squares have an odd number of factors. ... 16 also has odd number of factors, 1, 2, 4, 8, 16. The reason for this is, for numbers other than perfect squares, all factors are in the form of pairs, but for perfect squares, one factor is single and makes the total as odd.
Explanation:
Answered by
0
num=list(input("enter number: "))
count = 0
for i in num:
if eval(i) % 2 != 0:
count+=1
print(count)
count = 0
for i in num:
if eval(i) % 2 != 0:
count+=1
print(count)
Similar questions