Which Of The C Code Should Be Added To Get The Following Output #122
Which of the C# code should be added to get the following output? </p> <pre><code class="language-csharp" line="1"> * * * * * * * * * * * * * * * static void Main(string[] args) { int i,j; /* Add code here */ } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Looping Statements - For Loop Statements - Quiz No.1.
Which of the C# code should be added to get the following output?
* * * * * * * * * * * * * * * static void Main(string[] args) { int i,j; /* Add code here */ }
for (i = 0;i <= 4; i++) { for(j = 0;j <= 4; j++) console.WriteLine("*"); console.WriteLine("\n"); }
for (i = 0;i <= 4; i++) { for(j = 4;j <= i; j--) console.WriteLine("*"); console.WriteLine("\n"); }
for (i = 0;i <= 4; i++) { for (j = i;j <= 4; j++) console.WriteLine("*"); console.WriteLine("\n"); }
for ( i = 0;i <= 4; i++) { for (j = 0;j <= i; j++) console.WriteLine("*"); console.WriteLine("\n"); }