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...

If TextModel or Billboard objects are to be fixed in place in front of the camera, they should be the first objects you add to a world or scene.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

When you have a project open in Visual Studio, the time during which you build the GUI and write the application’s code is referred to as ____________.

a. prototyping b. design time c. visual planning d. application progression

Computer Science & Information Technology

A theme is a collection of formatting options that include a specified font, font size, font styles, font color, fill color, and borders. _________________________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Touch events are designed specifically for touchscreen devices.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology