while Loop

A loop that repeats while its condition remains true.

What is while Loop in C#?

while Loop — A loop that repeats while its condition remains true.

class Counter
{
    int CountToThree()
    {
        int number = 0;

        while (number < 3)
        {
            number++;
        }

        return number;
    }
}

Level: Apprentice · More C# terms at this level

Updated

In other subjects