# Recursion

A technique in which a method calls itself with a smaller version of the problem.

## What is **Recursion** in C#?

**Recursion** — A technique in which a method calls itself with a smaller version of the problem.

```csharp
class Countdown
{
    int Count(int number)
    {
        if (number == 0)
        {
            return 0;
        }

        return 1 + Count(number - 1);
    }
}
```

Level: Apprentice · [More C# terms at this level](https://www.ask-codey.com/glossary/subjects/c-sharp/apprentice)

Updated: September 27, 2026

## In other subjects

- [Recursion in Java](https://www.ask-codey.com/glossary/recursion-java)
- [Recursion in JavaScript](https://www.ask-codey.com/glossary/recursion-javascript)

Source: https://www.ask-codey.com/glossary/recursion-c-sharp
