Friday 1 December 2017

C# Program to Find the Rank of a given Array


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:





















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...