Home »
MCQs »
C# MCQs
Which of the correct syntax to declare an array with 2 rows and 3 columns in C#?
70. Which of the correct syntax to declare an array with 2 rows and 3 columns in C#?
- int arr[2][3] = new int[2][3];
- int arr[2,3] = new int[2,3];
- int[,] arr = new int[2,3];
- int [,]arr = new [2,3]int;
Answer: C) int[,] arr = new int[2,3];
Explanation:
The correct way to declare an array with 2 rows and 3 columns in C# is:
int[,] arr = new int[2,3];