c++ ##_##
Correct answer: 3
int [2,3]arr = new int[2,3];
int [2,3]arr = new int[2,3]; - correct way to declare an array with 2 rows and 3 columns.
正确答案:3
int [2,3] arr = new int [2,3];
int [2,3] arr = new int [2,3]; -声明具有2行3列的数组的正确方法。
Correct answer: 1
Yes
Yes, we can create 4-dimensional arrays in C#.NET.
static void Main(string[] args)
{
int[, , ,] ARR = new int[2, 2, 2, 2];
Console.WriteLine(ARR.Length);
}
Correct answer: 2
16
The output of the above code will be 16 = (2 x 2 x 2 x 2 =16).
static void Main(string[] args)
{
string[] S = new string{ "XXXX", "YYYY" };
Console.WriteLine(S[0] + " " + S[1]);
}
Correct answer: 2
Syntax Error
The above code will generate a syntax error because the declaration of an array of strings is not correct.
static void Main(string[] args)
{
string[] S = new string[2]{ "XXXX", "YYYY" };
Console.WriteLine(S[0] + " " + S[1]);
}
Correct answer: 1
XXXX YYYY
The above code will print "XXXX YYYY" on console screen.
正确答案:1
XXXX YYYY
上面的代码将在控制台屏幕上打印“ XXXX YYYY” 。
翻译自: https://www.includehelp.com/dot-net/csharp-arrays-aptitude-questions-and-answers-5.aspx
c++ ##_##