Multiple Choice
Example Code Ch 12-2
Given the following recursive factorial method:
public int factorial(int x)
{
if (x > 1) return x * factorial (x - 1) ;
else return 1;
}
-Refer to Example Code Ch 12-2: What is returned if factorial(0) is called?
A) 0
B) 1
C) 2
D) nothing, factorial(0) causes infinite recursion
E) nothing, factorial(0) produces a run-time error
Correct Answer:

Verified
Correct Answer:
Verified
Q21: The game of high-low is one where
Q22: Example Code Ch 12-2<br>Given the following recursive
Q23: Example Code Ch 12-4<br>The following recursive method
Q24: Example Code Ch 12-4<br>The following recursive method
Q25: Provide a definition for the following terms
Q27: Rewrite the following iterative method as a
Q28: Demonstrate how factorial(4) is computed given the
Q29: Recall the Towers of Hanoi recursive solution
Q30: Recursion is a popular programming tool but
Q31: Consider the following recursive sum method:<br>public int