#PROGRAM TO CALCULATE THE FACTORIAL USING RECURSION
def factorial(n):
if n==1:
return 1
elif n>1:
return n*factorial(n-1)
#MAIN
a=int(input('enter the number for the factorial'))
print('Factorial for the number',a,'is :',factorial(a))
def factorial(n):
if n==1:
return 1
elif n>1:
return n*factorial(n-1)
#MAIN
a=int(input('enter the number for the factorial'))
print('Factorial for the number',a,'is :',factorial(a))
Comments
Post a Comment
THANK YOU FOR COMMENTING !
PLEASE SUBSCRIBE TO OUR WEBSITE FOR LATEST UPDATES