How many times the function factorial will be executed?
#include
int factorial(int);
int main()
{
int n=10;
long int f; f=factorial(n);
printf("%d!=%1d\n",n,f);
return 0;
}
int factorial(int n)
{
if(n==0)
return 1;
else
return (n*factorial(n-1));
}
HINT:-Numeric answer
Answers
Answered by
3
Answer:
10 times
Explanation:
as it is a recursive function.
calling itself again n Again.
Similar questions