1.

Which of the following recursive formula can be used to find the factorial of a number?(a) fact(n) = n * fact(n)(b) fact(n) = n * fact(n+1)(c) fact(n) = n * fact(n-1)(d) fact(n) = n * fact(1)I had been asked this question in quiz.I'm obligated to ask this question of Factorial using Recursion topic in chapter Recursion of Data Structures & Algorithms II

Answer»

Correct ANSWER is (c) fact(n) = n * fact(n-1)

For explanation: fact(n) = n * fact(n – 1) can be used to find the factorial of a NUMBER.



Discussion

No Comment Found

Related InterviewSolutions