Two Dimensional Array In C Sharp
using System;
class TwoDimensionalArray
{
static void Main()
{
int[,] arr1 = new int[2,3];
int rows = arr1.GetLength(0);
int cols = arr1.GetLength(1);
for(int i=0;i<rows;i++)
{
for(int j=0;j<cols;j++)
{
Console.Write("Enter the value at arr1[{0},{1}] \t ", i,j);
arr1[i,j] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine();
}
for(int i=0;i<rows;i++)
{
for(int j=0;j<cols;j++)
{
Console.Write(arr1[i,j] + "\t");
}
Console.WriteLine();
}
}
}
----------------------------------------------------------------------------------------------------------
Two Dimensional Array In C Sharp
Reviewed by Baljeet Singh
on
22:47
Rating:
![Two Dimensional Array In C Sharp](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBIWbKkMn_PXh6okDS5G0ZDDzsAoOeWTg0hZRLDiSMovU4K8wEgGOjAKc0w8RziI-4F_Q-SulUaLPc7SocgcWZ5-E-bJ_15TkBmrbYh9mhpL7qJ3jfl2gLc45aoPUWSwpGgdbIw1P1J8BM/s72-c/img.png)
No comments: