Skip to content

Instantly share code, notes, and snippets.

@paulohenriquesn
Created June 30, 2018 07:02
Show Gist options
  • Save paulohenriquesn/02fb900aaa0529a22180e6378eb47b46 to your computer and use it in GitHub Desktop.
Save paulohenriquesn/02fb900aaa0529a22180e6378eb47b46 to your computer and use it in GitHub Desktop.
public static int FirstFactorial(int num)
{
int[] memory = new int[num+1];
for(int i = 0; i < num+1; i ++)
{
memory[i] = i;
}
num = 1;
for(int x=0; x < memory.Length; x ++ )
{
if(x>0)
num = num * memory[x];
}
return num;
}
@paulohenriquesn
Copy link
Author

8 returns = 40320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment