Solved

For the Questions Below, Refer to the Following Recursive Factorial

Question 5

Multiple Choice

For the questions below, refer to the following recursive factorial method.
public int factorial(int x)
{
if (x > 1) return x * factorial (x - 1) ;
else return 1;
}
-How many times is the factorial method invoked if originally called with factorial(5) ? Include the original method call in your counting.


A) 1
B) 4
C) 5
D) 6
E) 7

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