Multiple choice technology programming languages

Which of the following statements correctly declares a 2 dimensional array in c#?

  1. int[,] myarray;

  2. int[][] myarray

  3. int[2] myarray

  4. none of above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In C#, a two-dimensional array is declared using the syntax int[,] myarray - the comma inside the brackets indicates a multidimensional array. Option B (int[][]) declares a jagged array (array of arrays), which is different from a true 2D array. Option C is invalid syntax.