How to find the Rank of a given Array in C#?

CsharpProgrammingServer Side Programming

To find the rank of an array, use the Rank property.

Firstly, declare and initialize an array.

int[,] myArr = new int[3,3];

Now, get the rank.

myArr.Rank

Let us see the complete code −

Example

 Live Demo

using System;
class Demo {
   static void Main() {
      int[,] myArr = new int[3,3];
      Console.WriteLine("Rank of Array : " + myArr.Rank);
   }
}

Output

Rank of Array : 2
raja
Published on 21-Aug-2018 09:19:01
Advertisements