You need to end the recursion at some point:
int factorial(int b) /*Function definition*/
{
if (b == 0) return 1;
return b*factorial(b-1);
}
2
solved why does this recursive program for factorial not work? [closed]
You need to end the recursion at some point:
int factorial(int b) /*Function definition*/
{
if (b == 0) return 1;
return b*factorial(b-1);
}
2
solved why does this recursive program for factorial not work? [closed]