Jagged array

Ersudeep13
Posted by Ersudeep13 under .NET Framework category on | Points: 40 | Views : 530
Jagged Array-- An array which contains another array with in it is known as jagged array. a jagged array is known as Arrays of array

PRogram for jagged Array------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace pr
{
class Program
{
static void Main(string[] args)
{
int[][] A = new int[3][];
A[0] = new int[5] { 2, 5, 7, 4, 9 };
A[1] = new int[4] { 3, 6, 7, 8 };
A[2] = new int[6] { 5, 78, 54, 65, 34, 90 };
Console.WriteLine("elements of jagged array are :-");
for (int R = 0; R < A.Length; R++)
{
for (int C = 0; C < A[R].Length; C++)
{
Console.Write(A[R][C] + " ");
}
Console.WriteLine();
}
Console.Read();
}
}
}

Comments or Responses

Login to post response