Move more out of the for loop

image_pdfimage_print

/*
C#: The Complete Reference
by Herbert Schildt

Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/
// Move more out of the for loop.

using System;

public class Empty2 {
public static void Main() {
int i;

i = 0; // move initialization out of loop
for(; i < 10; ) { Console.WriteLine("Pass #" + i); i++; // increment loop control var } } } [/csharp]