Use the Length array property : Array : Collections Data Structure C# Source Code


Custom Search

C# Source Code » Collections Data Structure » Array »

 

Use the Length array property









    

// Use the Length array property.  
 
using System; 
 
public class LengthDemo {  
  public static void Main() {  
    int[] nums = new int[10];  
 
    Console.WriteLine("Length of nums is " + nums.Length);  
  
    for(int i=0; i < nums.Length; i++)  
      nums[i] = i * i;  
  
    Console.Write("Here is nums: "); 
    for(int i=0; i < nums.Length; i++)  
      Console.Write(nums[i] + " ");  
 
    Console.WriteLine(); 
  }  
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Collections Data Structure
» Array