Tech Study

C# Program to get Length of Array

Introduction

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

Write C# Program to get the Length of the Array
Write C# Program to get the Length of the Array

 

Here are some more c# programs for your practice :

C# program to count total duplicate elements in an array

Convert Base64 string to Byte Array using C#

TaggedWrite C# Program to get the Length of the Array

Python Examples

Introduction: Python Examples are the basic programming concepts of python like python syntax,python data types,,python operators,python if else,python comments etc.. …

Read more

C String Functions

C String Functions perform certain operations, It provides many useful string functions which can come into action. The <string.h> header …

Read more