Solved

Complete the Code for the MyFactorial Recursive Method Shown Below

Question 41

Multiple Choice

Complete the code for the myFactorial recursive method shown below, which is intended to compute the factorial of the value passed to the method: public int myFactorial(int anInteger)
{
If (anInteger == 1)
{
Return 1;
}
Else
{
______________________
}
}


A) return(anInteger * (myFactorial(anInteger) ) ) ;
B) return ((anInteger - 1) * (myFactorial(anInteger) ) ) ;
C) return(anInteger * (myFactorial(anInteger - 1) ) ) ;
D) return((anInteger - 1) *(myFactorial(anInteger - 1) ) ) ;

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