In the following code that uses recursion to find the factorial of a number, what is the base case?

```
private static int factorial(int n)
{
if (n == 0)
return 1;
else
return n * factorial(n - 1);
}
```

a. factorial(int n)
b. if (n == 0)
return 1;
c. else
return n * factorial(n - 1);
d. Cannot tell from this code

b. if (n == 0)
return 1;

Computer Science & Information Technology

You might also like to view...

References should not be included in your resume

Indicate whether the statement is true or false

Computer Science & Information Technology

When securing a network only the servers should be patched

Indicate whether the statement is true or false.

Computer Science & Information Technology