Start by simplifying it and testing the FindFact function:
int main(void)
{
int num, y;
num = 6;
y=FindFact(num);
printf("factorial of %d=%d\n",y,num);
return 0;
}
If that works, then you know that it's probably not the FindFact function that causes the problem. If it doesn't, then you know it is FindFact and can focus on that.
So restore your original code, and start running it through the debugger. Look at exactly what is happening, and watch what variables contain. Try to predict what is going to happen before you execute a line of code. Does it happen? If it does, move on. If it didn't, then why not? What did happen? why didn't you expect that?
This is the first stage after coding: test and debugging - and it's a skill that like all skills needs to be used in order to improve. And it's better to learn and practice on a trivial project like this one than when faced with 20,000 lines of code! :laugh: