|
-
May 10th, 2010, 11:24 AM
#6
Re: Compute a factorial.
 Originally Posted by Zlatomir
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|