int arrays : Int array : Data Type C# Examples


C# Examples » Data Type » Int array »

 

int arrays









    
using  System;

class  MainClass
{

    public  static  void  Main()
    {

        
        int[]  intArray  =  new  int[10];
        int  arrayLength  =  intArray.Length;

        Console.WriteLine("arrayLength  =  "  +  arrayLength);

        for  (int  counter  =  0;  counter  <  arrayLength;  counter++)
        {
            intArray[counter]  =  counter;
            Console.WriteLine("intArray["  +  counter  +  "]  =  "  +  intArray[counter]);
        }

    }

}
    
   
  
   



Output

arrayLength = 10
intArray[0] = 0
intArray[1] = 1
intArray[2] = 2
intArray[3] = 3
intArray[4] = 4
intArray[5] = 5
intArray[6] = 6
intArray[7] = 7
intArray[8] = 8
intArray[9] = 9


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Int array