# Infinite Loop

A loop whose stopping condition never becomes false.

## What is **Infinite Loop** in C#?

**Infinite Loop** — A loop whose stopping condition never becomes false.

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

- [Infinite Loop in Java](https://www.ask-codey.com/glossary/infinite-loop-java)

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