Console.WriteLine("———————————————————————————————————————————");Console.WriteLine("Program to print the jagged array");Console.WriteLine("———————————————————————————————————————————");int[][]arr=newint[3][];arr[0]=newint[]{23,34,5,99,58,14,59};arr[1]=newint[]{23,34,5,99,58,14};arr[2]=newint[]{23,34,5,99};for(inti=0;i<arr.Length;i++){for(intj=0;j<arr[i].Length;j++){System.Console.Write(arr[i][j]+" ");}System.Console.WriteLine();}Console.WriteLine("———————————————————————————————————————————");
Output
kodingwindow@kw:~/csharp$ dotnet run
———————————————————————————————————————————
Program to print the jagged array
———————————————————————————————————————————
23 34 5 99 58 14 59
23 34 5 99 58 14
23 34 5 99
———————————————————————————————————————————
kodingwindow@kw:~/csharp$
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.