Complete The Following C Code With Foreach Conditionp Pre #219
Complete the following C# code with "foreach condition".</p> <pre><code class="language-csharp" line="1"> int[][]a = new int[2][]; a[0] = new int[3]{3, 4, 2}; a[1] = new int[2]{8, 5}; foreach( int[]i in a) { /* add for loop */ console.write( j+ " "); console.writeline(); } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Arrays and Strings - Array and Initialization - Quiz No.1.
Complete the following C# code with "foreach condition".
int[][]a = new int[2][]; a[0] = new int[3]{3, 4, 2}; a[1] = new int[2]{8, 5}; foreach( int[]i in a) { /* add for loop */ 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);