Solved

String [ , ] Name = New String [2, 3]

Question 58

Multiple Choice

string [ , ] name = new string [2, 3] {{"Alex", "Ben", "Cay"}, {"Jose", "Tyne", "Yin" }};
-Which of the following segments of code will display the first row of a two dimensional array?


A) for (int i = 0; i < anArray.GetLength(1) ; i++)
Console.Write(anArray[0, i] + "\t") ;
B) for (int i = 0; i < anArray.GetLength(0) ; i++)
Console.Write(anArray[0, i] + "\t") ;
C) for (int i = 0; i < anArray.GetLength(0) ; i++)
Console.Write(anArray[i, 0] + "\t") ;
D) for (int i = 0; i < anArray.GetLength(1) ; i++)
Console.Write(anArray[i, 0] + "\t") ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions