programming-examples/c-sharp/Arrays/C# Program to Find the Rank of a given Array.cs

26 lines
633 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C# Program to Find the Rank of a given Array
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CSharpDemoApps
{
class Program
{
static void Main(string[] args)
{
int[] array1 = new int[5] { 1, 2, 3, 4, 5 };
int[,] array2 = new int[10, 3];
Console.WriteLine("Total dimensions of Array is : " + array1.Rank);
Console.WriteLine("Total dimensions of Array is : " + array2.Rank);
Console.ReadLine();
}
}
}
/*
Total dimensions of Array is : 1
Total dimensions of Array is : 2