Skip to content

Commit

Permalink
Add C# factorial algorithm (Asiatik#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvillan16 authored and tstreamDOTh committed Oct 16, 2018
1 parent 2b073da commit 074c449
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Maths/Factorial/C#/Factorial.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
 class Factorial
{
public static long factorial(int inputNum)
{
if (inputNum == 1)
{
return 1;
}
else
{
return inputNum * factorial(inputNum - 1);
}
}
}

0 comments on commit 074c449

Please sign in to comment.