C# Programming - Arrays - Discussion

Discussion Forum : Arrays - General Questions (Q.No. 5)
5.
How will you complete the foreach loop in the C#.NET code snippet given below such that it correctly prints all elements of the array a?
    int[][]a = new int[2][];
    a[0] = new int[4]{6, 1 ,4, 3};
    a[1] = new int[3]{9, 2, 7}; 
    foreach (int[ ] i in a)
    {
        /* Add loop here */
        Console.Write(j + " ");
        Console.WriteLine(); 
    }
foreach (int j = 1; j < a(0).GetUpperBound; j++)
foreach (int j = 1; j < a.GetUpperBound (0); j++)
foreach (int j in a.Length)
foreach (int j in i)
foreach (int j in a.Length -1)
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Anomie said:   7 months ago
Anyone, Please explain.

Tony said:   8 years ago
Please, can anyone explain me?
(1)

Post your comments here:

Your comments will be displayed after verification.