Click here to Skip to main content
15,499,571 members
Articles / Programming Languages / C#

Tagged as

Stats

15.5K views

Calculate the Factorial of an Integer in C#

Rate me:
Please Sign up or sign in to vote.
2.25/5 (6 votes)
3 Oct 2011CPOL
Use Recursion.int factorial(int n){ if(n<0) return -1; if(n==0 || n==1) return 1; return n * factorial(n-1);}

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions