for Loop

noun

say it: “FOR loop” /fɔːr luːp/

A loop that keeps its start, condition and step together in one line, used for counting.

What is for Loop in C#?

for Loop — A loop that keeps its setup, condition, and update together.

class Schedule
{
    void MarkDays(bool[] scheduled)
    {
        for (int day = 0; day < scheduled.Length; day++)
        {
            scheduled[day] = true;
        }
    }
}

In a sentence

  • “A for loop prints the scores from index 0 to the last one.”

Level: Apprentice · More C# terms at this level

Updated

In other subjects