#include<stdio.h>
int fact(int i);
void main()
{
int j;
j=fact(4);
printf("%d",j);
}
int fact(int i){
int x=i;static int tot=1;
if(x<1){
tot=x*fact(x-1);
}
return tot;
}
Please help me with this code. What is wring in this code?
You do not have a base condition in the fact function.
You need to check: