C# for loop with already defined iterator
<p>I want to make a loop using an already-defined iterator. </p>

<p>At present I am using </p>

<pre><code>int i;
while (i&lt;10)
{
    Console.Writeline(i);
    i++;
}
</code></pre>

<p>This is ugly because someone else might later remove the i++. If it is separated from the while statement by a large block of code, it will not be clear what it is for. </p>

<p>What I'd really like is something like</p>

<pre><code>int i;
for (i&lt;10; i++)
{
    Console.Writeline(i);
}
</code></pre>

<p>This makes it clear what's going on, but it's not valid C#. </p>

<p>The best I've come up with so far is </p>

<pre><code>int i;
for (int z; i&lt;10; i++)
{
    Console.Writeline(i);
}
</code></pre>

<p>But that's ugly. Does C# give me an elegant way of doing it? </p>
