[Linker error] undefined reference to `factorial(int)'

i have a problem. it's said "[Linker error] undefined reference to `factorial(int)'"

So, what should i do with this ::
#include <stdio.h>
#include <algorithm>
int factorial(int);
int factorial(int);
int combination(int, int);
int main()
{
int cases;
int n,r,x;
scanf("%d",&cases);
while(cases--)
{
scanf("%d",x);
n=4*x;r=3;
int combination(int n, int r);
}
int f1 = factorial(n);
int f2 = factorial(r);
int f3 = factorial(n-r);
{
printf("%d\n",(f1/(f2*f3)));
}

system("PAUSE");
return 0;
}


i'll be waiting for your answer. thanks :))
Well, I'd say the problem is that you never define factorial or combination anywhere.

Also, why do you have int combination(int n, int r); randomly in the middle of your code?
and then, what should i do??
i'm just a beginner programmer
Topic archived. No new replies allowed.