Multidimensional implicitly typed arrays in C#
- Below program illustrate the use of Multidimensional implicitly typed arrays.
static public void Main()
{
// Creating and initializing
// 2-D implicitly typed array
var language = new[,] { {"C", "C#"},
{"Python", "C#"} };
Console.WriteLine("Programming Languages: ");
// taking a string
string a;
// Display the value at index [1, 0]
a = language[1, 0];
Console.WriteLine(a);
// Display the value at index [0, 2]
a = language[0, 1];
Console.WriteLine(a);
Console.ReadLine();
}
</div>
No comments