Demonstrate a one-dimensional array : Array : Collections Data Structure C# Source Code


Custom Search

C# Source Code » Collections Data Structure » Array »

 

Demonstrate a one-dimensional array









    

// Demonstrate a one-dimensional array. 
 
using System; 
 
public class ArrayDemo {  
  public static void Main() {  
    int[] sample = new int[10]; 
    int i;  
  
    for(i = 0; i < 10; i = i+1) { 
      sample[i] = i; 
    }  
 
    for(i = 0; i < 10; i = i+1)  {
      Console.WriteLine("sample[" + i + "]: " + sample[i]);  
    }
  }  
}


           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Collections Data Structure
» Array