Skip to content

Instantly share code, notes, and snippets.

@Ch-sriram
Created May 31, 2020 11:24
Show Gist options
  • Select an option

  • Save Ch-sriram/38107caae8ddecc6e29559cfc122a0eb to your computer and use it in GitHub Desktop.

Select an option

Save Ch-sriram/38107caae8ddecc6e29559cfc122a0eb to your computer and use it in GitHub Desktop.
Given N, return N! ["N factorial"] [Naive Solution]
int fact(int n) {
if (n==0) return 1;
return n * fact(n-1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment