using System; namespace Example53 { /// /// Summary description for Class1. /// class Class1 { /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { // 2-dimensional array int[,] a = new int[5, 3]; for (int i = 0; i < a.GetLength(0); i++) for (int j = 0; j < a.GetLength(1); j++) a[i,j] = i - j; Console.WriteLine("Number of elements= " + a.Length); for (int i = 0; i < a.GetLength(0); i++) { for (int j = 0; j < a.GetLength(1); j++) { Console.Write(a[i, j] + " "); } Console.WriteLine(); } } } }