Function To Find Factorials!!! Please Help
i need to write a function to find factorials of numbers the catch is i can only use + or - for and while loops..
eg 5! = 5 x 4 x 3 x 2 x 1 = 120
i cannot use any * in it;
this is what i have so far
the factorial has been entered in another function and is passed to this one
void find_factorials(int factorial)
{
int count = 0;
int answer = 0;
int i = 1;
int n = factorial;
for(n = factorial ; n>0 ;n--)
{
for(count = factorial - i; count >0; count--)
{
answer = answer + factorial;
}
i++ ;
}
}
can someone please help me thanks heeps :)