Tracks
/
C#
C#
/
Syllabus
/
While Loops
Wh

While Loops in C#

8 exercises

About While Loops

To repeatedly execute logic, one can use loops. One of the most common loop types in C# is the while loop, which keeps on looping until a Boolean condition evaluates to false.

int x = 23;

while (x > 10)
{
    // Execute logic if x > 10
    x = x - 1;
}
Edit via GitHub The link opens in a new window or tab

Learn While Loops

Practicing is locked

Unlock 6 more exercises to practice While Loops