Use commas in a for statement. : For : Statement C# Examples


C# Examples » Statement » For »

 

Use commas in a for statement.









    
using  System;  
  
class  MainClass  {        
    public  static  void  Main()  {        
        int  i,  j;  
  
        for(i=0,  j=10;  i  <  j;  i++,  j--)  
            Console.WriteLine("i  and  j:  "  +  i  +  "  "  +  j);  
    }  
}
    
   
  
   



Output

i and j: 0 10
i and j: 1 9
i and j: 2 8
i and j: 3 7
i and j: 4 6


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Statement
» For