Skip to content

Instantly share code, notes, and snippets.

@KushalP
Created April 5, 2010 21:54
Show Gist options
  • Save KushalP/356948 to your computer and use it in GitHub Desktop.
Save KushalP/356948 to your computer and use it in GitHub Desktop.
/**
* A recursive factorial method
*/
int factorial(int n)
{
if (n == 0)
{
return 1;
}
else
{
return n*factorial(n-1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment