1. ## Factorial Computation Program

Ok, so Im trying to write a program that computes factorials recursively.

Here is what Ive got (when I asked my teacher for help, he said my factorial.cpp has one key flaw but I cant find it)

Factorial.cpp

Code:
```int factorial(int N)
{
//cout << "into factorial with " << N << endl;
if ( N < 1 )
return 1; // base case
//cout << " not a base case with N = " << N << endl;
//cout << " returning " << answer << " as answer at N = " << N << endl;
}```

driveFactorial.cpp
Code:
```
#include <iostream>
#include <fstream>
using namespace std;

#include "factorial.cpp"

int main()
{
int FactForN = 1;

cout << "\n Factorial of what number?  (negative to end) ";

while ( cin >> FactForN && FactForN > 0)
{
cout << "\n The factorial of " << FactForN << " is " << answer << endl;

cout << "\n Factorial of what number?  (negative to end) ";
}
}```

any help would be appreciated. Thanks!

2. Code:
`if ( N < 1 )`
There is no 0 in factorials. Your base case would be when N = 1.

3. so I should make it n=1 and not n <1?

4. 0! is 1 so his base case is correct.

If we use 0!=1 as our base case then in general,
N! = N*(N-1)!
Compare that to what you are doing.

ALSO, you should include .h files, not .c files