# do-while Loop

*noun*

say it: **“DOO WYLE loop”** **/duː waɪl luːp/**

A loop that runs its block once first and then repeats while its condition stays true.

## What is **do-while Loop** in C#?

**do-while Loop** — A loop that runs its body once before checking whether to repeat.

```csharp
class Counter
{
    int CountToThree()
    {
        int number = 0;

        while (number < 3)
        {
            number++;
        }

        return number;
    }
}
```

## In a sentence

- “A **do-while loop** shows the menu once before checking whether the user wants to quit.”

Level: Apprentice · [More C# terms at this level](https://www.ask-codey.com/glossary?category=c-sharp&level=2)

Updated: November 9, 2026

## In other subjects

- [do-while Loop in Java](https://www.ask-codey.com/glossary/do-while-loop)

Source: https://www.ask-codey.com/glossary/do-while-loop-c-sharp
