> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baenninger.me/llms.txt
> Use this file to discover all available pages before exploring further.

# for-Loops

Mit `for`-Loops können wir Codeblöcke wiederholen, bis eine bestimmte Bedingung erfüllt ist.

<Tabs>
  <Tab title="Syntax">
    ```csharp theme={null}
    for (initialization; condition; iteratore) 
    {
        ..
    }
    ```
  </Tab>

  <Tab title="Beispiel">
    ```csharp theme={null}
    int n = 5,
    int sum = 0;

    for (int i = 1; i <= n; i++)
    {
       sum += i;
    }

    Console.WriteLine($"Sum of first {n} natural numbers = {sum}");
    ```
  </Tab>

  <Tab title="Output">
    ```text theme={null}
    Sum of first 5 natural numbers = 15
    ```
  </Tab>
</Tabs>
