Skip to content

Instantly share code, notes, and snippets.

@alexyakunin
Last active October 6, 2015 01:38
Show Gist options
  • Save alexyakunin/c020e06cff5d7f0410cb to your computer and use it in GitHub Desktop.
Save alexyakunin/c020e06cff5d7f0410cb to your computer and use it in GitHub Desktop.
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