Q:

Write C# Program to get the Length of the Array

0

Write C# Program to get the Length of the Array

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability.

using System;
class Program
{
    static void Main()
    {
 
        int[] arrayA = new int[10];
        int lengthA = arrayA.Length;
        Console.WriteLine("Length of ArrayA : {0}", +lengthA);
        long longLength = arrayA.LongLength;
        Console.WriteLine("Length of the Long Length Array  : {0}", longLength);
        int[,] twoD = new int[20, 50];
        Console.WriteLine("The Size of 2D Array is : {0}", twoD.Length);
        Console.ReadLine();
    }
}

Result:

Length of ArrayA : 10

Length of the Long Length Array  : 10

The Size of 2D Array is : 1000

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write C# Program to Convert a 2D Array into 1D Arr... >>