What will the following C++ code print?
#include <iostream>
using namespace std;
int factorial(int n)
{
if (n == 0)
return 1;
return n * factorial(n - 1);
}
int main()
{
cout << factorial(0);
return 0;
}
Options
- B. 1
- C. Undefined reference
- D. More than one of the above
- E. None of the above