Solved

Complete the Code for the MyFactorial Recursive Method Shown Below

Question 1

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

Related Questions