Post Page Advertisement [Top]

python program

Write a program in python to calculate factorial by using recursive function.

code:

def fec(x):
     if x==1:
          return x
     else:
          return x*fec((x-1))
x=int(input("Enter No : "))
i=fec(x)
print(i)


Thank-you

No comments:

Post a Comment

Bottom Ad [Post Page]