VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/how-to-find-the-rank-of-an-array-in-c-sharp/

⇱ How to find the rank of an array in C# - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to find the rank of an array in C#

Last Updated : 11 Jul, 2025
Array.Rank Property is used to get the rank of the Array. Rank is the number of dimensions of an array. For example, 1-D array returns 1, a 2-D array returns 2, and so on. Syntax:
public int Rank { get; }
Property Value: It returns the rank (number of dimensions) of the Array of type System.Int32. Below programs illustrate the use of above-discussed property: Example 1:
Output:
Dimension of weekDays array: 1
Example 2:
Output:
Dimension of arr2d array: 2
Dimension of arr3d array: 3
Dimension of jdarr array: 1
Note: Reference:
Comment
Article Tags:
Article Tags:

Explore