Help On Factorial

hi guys…When ever i try to find 8 factorial on turbo c…it gives me a negative value…(-25216)
it works well till 7 factorial…why so?..and how can i remove this error…and use to find factorial of large numbers?

read this Tutorial for Factorials

For such small values you can use long long int.

This should help: http://www.codechef.com/wiki/tutorial-small-factorials

When you are done reading, you can try this problem: http://www.codechef.com/problems/FCTRL2/

Happy coding. :slight_smile: