x=int(input(“Enter an number:”))
a=0
count=0
for s in range(0,x):
a=a+1
if(x%a==0):
print(“\nDivident = “,a)
count=count+1
print(“Number of divisor is “,count)

Explanation:

Inside the for loop program calculate all the divisor because of if condition . for loop increase the divisor value by one in each time and likely if condition check if the given number is divisible by increment value ( (x%a==0 ) if this condition is true then program shows the required result and simultaneously program will cont the number of divisors.

Leave a Reply

Your email address will not be published. Required fields are marked *