Created
December 30, 2016 02:45
-
-
Save dzsquared/68bcfd9f2899acd2aa7d902f98989180 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| class Solution { | |
| static int factorial(int thenumber) { | |
| if(thenumber <= 1) { | |
| return 1; | |
| } else { | |
| return thenumber * factorial(thenumber-1); | |
| } | |
| } | |
| static void Main(String[] args) { | |
| int wheretostart = Convert.ToInt32(Console.ReadLine()); | |
| int theresponse = factorial(wheretostart); | |
| Console.WriteLine(theresponse); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment