Practice Functions – What is the output of the following problem ?
#include
int main() {
int factorial(int n);
int i,ans;
ans = factorial(5);
printf("
Factorial by recursion = %d
", ans);
return 0;
}
int factorial(int n)
{
if (n <= 1)
return (1);
else
return ( n * factorial(n-1));
}