Home / Programming MCQs / Python MCQs / Question

M

Mr. Dubey • 51.43K Points
Coach

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))
(A) 15
(B) 45
(C) 1
(D) 120

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.