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
c. 5
You might also like to view...
The insert function of HashTable can return false because:
A. the hash table may be full B. we may be out of heap memory C. a duplicate key already exists D. the client supplied a faulty hash function
When you choose to print comments and annotations (markup), the comments print on a separate page from the slides that display the annotations
Indicate whether the statement is true or false
According to MLA style, the correct punctuation for a citation at the end of a sentence is
A) . (Smith 21 ). B) (Smith, 21 ). C) .(Smith 21 ) D) (Smith 21 ).
If you click ________, the insertion point is displayed in the formula bar
A) in a cell B) a worksheet tab C) the Home tab D) in the formula bar