Editorial Staff - - C Sharp Tutorial
If you are a c# beginner or want to start learning the c# programming language, then this program will help you to understand the basics of c# programming. In this program, we are going to share C# program to get the length of an Array with the output.
To increase your C# knowledge, practice all C sharp programs:
Copy the below c# program and execute it in your Microsoft Visual Studio IDE (Integrated Development Environment ). At the end of this program, I have shared the output program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | using System; class Program { static void Main() { int[] arrayA = new int[9]; int lengthA = arrayA.Length; Console.WriteLine("Length of ArrayA : {0}", +lengthA); long longLength = arrayA.LongLength; Console.WriteLine("Length of the LongLength Array : {0}",longLength); int[,] twoD = new int[5, 11]; Console.WriteLine("The Size of 2D Array is : {0}",twoD.Length); Console.ReadLine(); } } |
Length of ArrayA : 9
Length of the LongLength Array : 9
The Size of 2D Array is : 55
Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari View all posts by Editorial Staff