Perhaps this would make more sense if you had a similar example:
Code:
#include <stdio.h>
/* the sum function calculates the sum of two integers x and y */
int sum(int x, int y);
int main(void) {
int x = 10;
int y = 5;
int answer = sum(x, y);
printf("Answer: %d\n", answer);
return 0;
}
int sum(int x, int y) {
return x + y;
}
Instead of factorial, I'm calculating the sum of two integers. As you can see, it's not enough to just call and declare the function sum, you must have the code written out that will calculate the sum of the two integers and return it's value back to the function that called it (main()). So in your case, you need to write the code for the factorial function.