We generally use a for loop or foeach to iterate through a normal array but how do we do it when we have a 2d array in C#. The following way can help.
var array = new int[,] { {1, 5},{7, 3},{3, 5} };
for (int j = 0; j < array.Length; j += 1) {
for (int k = 0; k < array[j].Length; k += 1) {
Console.Write(array[j][k]);
}
}