Quote Originally Posted by Zlatomir View Post
Code:
int factorial (int n)
{	
	int fact = 1;
	for (int i=1; i<=n;i++)
		fact = fact * i;
	return fact;
}
Here is a simple function for calculating factorial, if there is something that you don't understand just ask.
I tried this and it worked just fine.. but if u please, can you go through it step by step?