The For Loop
When you know exactly how many times you want to loop through a block of code, use the for loop.
Syntax
csharp for (int i = 0; i < 5; i++) { Console.WriteLine("Iteration number: " + i); }
Components
int i = 0: Initialization (starts the loop).i < 5: Condition (loop runs while this is true).i++: Increment (happens after each loop iteration).