Skip to content

Instantly share code, notes, and snippets.

@tmosest
Created January 24, 2017 23:10
Show Gist options
  • Save tmosest/682fdd7653fe00b527a3943b421cc663 to your computer and use it in GitHub Desktop.
Save tmosest/682fdd7653fe00b527a3943b421cc663 to your computer and use it in GitHub Desktop.
factorial.java
public static int factorial(int n)
{
if(n <= 1)
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