Q. What is the output of the below code?
Code:def fun(n,res=1):
if(n<=0):
return res
return fun(n-1,n*res)
print(fun(5))
β
Correct Answer: (D)
120
def fun(n,res=1):
if(n<=0):
return res
return fun(n-1,n*res)
print(fun(5))
You must be Logged in to update hint/solution