example of jagged arrary?

Sagarp
Posted by Sagarp under C# category on | Views : 1503
using System;

namespace Jaggedarray
{
/// <summary>
/// Summary description for Class6.
/// </summary>
public class Class6
{
static void Main(string[] args)
{
int [] [] arr=new int[3][];
int[]arr1=new int[1]{1};
int[]arr2=new int[2]{1,2};
int[]arr3=new int[3] {1,2,3};
Console.WriteLine("Eneter The Jagged array:");
for(int j=0;j<3;j++)
{
for(int i=0;i<arr[j].Length;i++)
{
Console.Write(arr[j][i]+"\t");
}
Console.WriteLine();
}


Console.Read();



}
}
}

Comments or Responses

Login to post response