using System;
public class Program
{
public static void Main()
// Using a foreach statement to iterate through an array. Read-only.
int[] bits = {128, 64, 32, 16, 8, 4, 2, 1};
foreach(int bit in bits)
Console.WriteLine(bit);
}
int[,] matrix = {
{1, 2, 3, 4},
{5, 6, 7, 8},
};
// Printing matrices/multidemensional arrays
for(int i = 0; i < matrix.GetLength(0); i++)
// Notice the GetLength() property for multidemnsional arrays.
for(int o = 0; o < matrix.GetLength(1); o ++)
Console.Write(matrix[i,o]);
// Make sure your have your iterations in the right place, or you
// might get a stack trace error.