Implement 2 dimension array in C#

Sourav.Kayal
Posted by Sourav.Kayal under C# category on | Points: 40 | Views : 1619
using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;
namespace Test1
{
class Program
{
static void Main(string[] args)
{

int [,]arr = new int[3,3];
arr[0, 0] = 100;
arr[0, 1] = 200;
arr[0, 2] = 300;

arr[1, 0] = 400;
arr[1, 1] = 500;
arr[1, 2] = 600;

arr[2, 0] = 400;
arr[2, 1] = 500;
arr[2, 2] = 600;

for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
Console.WriteLine(arr[i, j]);
}
}


Console.ReadLine();
}
}
}

Comments or Responses

Login to post response