Answers for "recursive function to return factorial"

0

factorial recursive

N= int(input())
def fun(n):
    if n ==1 or n==0:
        return 1
    else:
        n = n * fun(n-1)
        return n 


print(fun(N))
Posted by: Guest on June-26-2021
0

recursive factorial of a number

factorial(N){
    if(N<=1)
    {
      return 1;
    }
    else
    {
      return (N*factorial(N-1));
    }
}
Posted by: Guest on January-11-2022

Code answers related to "recursive function to return factorial"

Code answers related to "Javascript"

Browse Popular Code Answers by Language