Array : Array Bound : Data Structure C# Examples


C# Examples » Data Structure » Array Bound »

 

Array









    
using  System;

public  class  ArrayTest  {

        public  static  void  Main(  )  {
              int[]  array_1  =  new  int[5];
            
              for(  int  i  =  array_1.GetLowerBound(0);  i  <=  array_1.GetUpperBound(0);  i++)
                    array_1[i]  =  i+1;

              for(  int  j  =  array_1.GetLowerBound(0);  j  <=  array_1.GetUpperBound(0);  j++)
                    Console.WriteLine("array_1[{0}]  =  {1}",  j,  array_1[j]);

        }
}
    
   
  
   



Output

array_1[0] = 1
array_1[1] = 2
array_1[2] = 3
array_1[3] = 4
array_1[4] = 5


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» Array Bound