21
1
using System;
2
3
public class JaggedArraySampleProgram
4
{
5
public static void Main()
6
{
7
string[][] jaggedArrayStr = new string [2][] {
8
new string[] {"C#", "Java"},
9
new string[] {"C", "C++", "Objective-C"}
10
};
11
// traverse value from each array element
12
for (int i = 0; i < jaggedArrayStr.Length; i++) {
13
for (int j = 0; j < jaggedArrayStr[i].Length; j++) {
14
Console.Write(jaggedArrayStr[i][j]+ " ");
15
}
16
//new row, new line added
17
Console.WriteLine();
18
}
19
20
}
21
}
Cached Result