# While Loop

Repeat a block of code for as long as a condition stays true with C#'s while loop, and make sure the loop can end.

![Cheat sheet: While Loop](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/674fa2954a3b4e22814f1dd9840232bf.webp)

- Category: C#
- Level: Novice
- Tags: Console.ReadLine(), c-sharp, Infinite Loop (c-sharp), Iteration, while Loop (c-sharp)
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/looping-in-csharp-while-loop-cheat-sheet
