# Infinite Loop

*noun*

say it: **“IN-fih-nit loop”** **/ˈɪnfɪnɪt luːp/**

A loop that never stops, because its 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;
    }
}
```

## In a sentence

- “I forgot count++, so it became an **infinite loop** and I had to press Ctrl+C.”

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

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

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