Last active
October 6, 2015 01:38
-
-
Save alexyakunin/c020e06cff5d7f0410cb 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; | |
namespace CSharpRecursion | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Counted to {0}.", CountRecursively(10000)); | |
} | |
static int CountRecursively(int count) | |
{ | |
if (count <= 0) | |
return count; | |
return 1 + CountRecursively(count - 1); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment