#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=1,fact=1,n;
printf("enter the no of fact: ");
scanf("%d",&n);
factorial(n,fact,i);
return 0;
}
int factorial(int x,int y,int z)
{
int r;
if(x==1)
{
r=y*z;
printf("the fact is %d",r);
}
else
{
factorial(x--,y*z,z++);
}
}
hello iam trying recursion using factorial the complier stops working .i dont understand why compiler does that