Skip to content

Instantly share code, notes, and snippets.

@matthewmorrone
Created September 26, 2020 13:27
Show Gist options
  • Select an option

  • Save matthewmorrone/a179067d54ac59095a4b416dcd9ee129 to your computer and use it in GitHub Desktop.

Select an option

Save matthewmorrone/a179067d54ac59095a4b416dcd9ee129 to your computer and use it in GitHub Desktop.
static int factorial(int number) {
int result = 1;
for (int factor = 2; factor <= number; factor++) {
result *= factor;
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment