# break

A statement that immediately exits the nearest loop or switch.

## What does **break** do in C#?

**break** — A statement that immediately exits the nearest loop or switch.

```csharp
class NumberFinder
{
    int FirstOdd(int[] numbers)
    {
        foreach (int number in numbers)
        {
            if (number % 2 == 0)
            {
                continue;
            }

            return number;
        }

        return -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

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

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