Code:
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();
}
}
}
Output:
Total dimensions of Array is : 1
Total dimensions of Array is : 2
More C# Programs: