Declare the array and instantiate the array : Array : Data Structure C# Examples


C# Examples » Data Structure » Array »

 

Declare the array and instantiate the array









    
using  System;

class  MainClass
{
      static  void  Main()
      {
            int[]  myIntArray;                              
            myIntArray  =  new  int[4];                

            for  (int  i  =  0;  i  <  4;  i++)          
                  myIntArray[i]  =  i  *  10;

            for  (int  i  =  0;  i  <  4;  i++)          
                  Console.WriteLine(i);
      }
}
    
   
  
   



Output

0
1
2
3


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» Array