Solved

Given the Following Code That Uses Recursion to Find the Factorial

Question 23

Multiple Choice

Given the following code that uses recursion to find the factorial of a number, how many times will the else clause be executed if n = 5? private static int factorial(int n)
{
If (n == 0)
Return 1;
Else
Return n * factorial(n - 1) ;
}


A) 3
B) 4
C) 5
D) 6

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents