Trang Esther
New member
Which of the C# code should be added to get the following output?
A.
B.
C.
D.
Code:
* * * * *
* * * *
* * *
* *
*
static void Main(string[] args)
{
int i,j;
/* Add code here */
}
Code:
for (i = 0;i <= 4; i++)
{
for(j = 0;j <= 4; j++)
console.WriteLine("*");
console.WriteLine("\n");
}
Code:
for (i = 0;i <= 4; i++)
{
for(j = 4;j <= i; j--)
console.WriteLine("*");
console.WriteLine("\n");
}
Code:
for (i = 0;i <= 4; i++)
{
for (j = i;j <= 4; j++)
console.WriteLine("*");
console.WriteLine("\n");
}
Code:
for ( i = 0;i <= 4; i++)
{
for (j = 0;j <= i; j++)
console.WriteLine("*");
console.WriteLine("\n");
}