 for (int i = 0; i < 10; i++)


Is equivalent to this code represented with a statement, except here the variable is not local to the loop.int i = 0;
while (i < 10)


The statement is derived from the statement and makes use of a certain pattern described in C#'s language specification in order to obtain and use an enumerator of elements to iterate over.Each item in the given collection will be returned and reachable in the context of the code block.