Python Program To Find Factors Of A Number Using Recursion
Example
def factors(x,i): if(x >= i): if ((x%i)==0): print(i) factors(x,i+1) n=18 # n = int(input("Enter Integer Value: ")) factors(n,1)
Output:
1 2 3 6 9 18
USEFUL POSTS:
def factors(x,i): if(x >= i): if ((x%i)==0): print(i) factors(x,i+1) n=18 # n = int(input("Enter Integer Value: ")) factors(n,1)
Output:
1 2 3 6 9 18
USEFUL POSTS: