Move more out of the for loop : for : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » for »

 

Move more out of the for loop









    

/*
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 
    } 
  }   
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» for