How to get the length (size) of an array in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        int[] arr = new int[] {5, 9, 0, 3, 2, 8};
        
        int length = arr.Length;
        
        Console.WriteLine(length);
    }
}



/*
run:
 
6
 
*/

 



answered Jun 24, 2021 by avibootz
...