A for
statement evaluates a sequence of initialization expressions and then, while a condition is true, repeatedly executes a statement and evaluates a sequence of iteration expressions.
The example
using System; class Test { static void Main() { for (int i = 0; i < 10; i++) Console.WriteLine(i); } }
uses a for
statement to write out the integer values 1
through 10
.