Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C# Programming
»
Arrays
Which of the following statements is correct about the array declaration given below? int[][][] intMyArr = new int[2][][];
intMyArr refers to a 2-D jagged array containing 2 rows.
intMyArr refers to a 2-D jagged array containing 3 rows.
intMyArr refers to a 3-D jagged array containing 2 2-D jagged arrays.
intMyArr refers to a 3-D jagged array containing three 2-D jagged arrays.
intMyArr refers to a 3-D jagged array containing 2 2-D rectangular arrays.
Correct Answer:
intMyArr refers to a 3-D jagged array containing 2 2-D jagged arrays.
← Previous Question
Next Question→
More Questions from
Arrays
How will you complete the foreach loop in the C#.NET code snippet given below such that it correctly prints all elements of the array a? int[][]a = new int[2][]; a[0] = new int[4]{6, 1 ,4, 3}; a[1] = new int[3]{9, 2, 7}; foreach (int[ ] i in a) { /* Add loop here */ Console.Write(j + " "); Console.WriteLine(); }
Which of the following are the correct ways to define an array of 2 rows and 3 columns? int[ , ] a; a = new int[2, 3]{{7, 1, 3},{2, 9, 6}}; int[ , ] a; a = new int[2, 3]{}; int[ , ] a = {{7, 1, 3}, {2, 9,6 }}; int[ , ] a; a = new int[1, 2]; int[ , ] a; a = new int[1, 2]{{7, 1, 3}, {2, 9, 6}};
Which of the following is the correct way to define and initialise an array of 4 integers? int[] a = {25, 30, 40, 5}; int[] a; a = new int[3]; a[0] = 25; a[1] = 30; a[2] = 40; a[3] = 5; int[] a; a = new int{25, 30, 40, 5}; int[] a; a = new int[4]{25, 30, 40, 5}; int[] a; a = new int[4]; a[0] = 25; a[1] = 30; a[2] = 40; a[3] = 5;
Which of the following is the correct output of the C#.NET code snippet given below? int[ , , ] a = new int[ 3, 2, 3 ]; Console.WriteLine(a.Length);
Which of the following statements are correct about the C#.NET code snippet given below? int[][]intMyArr = new int[2][]; intMyArr[0] = new int[4]{6, 1, 4, 3}; intMyArr[1] = new int[3]{9, 2, 7};
Which of the following statements is correct about the C#.NET code snippet given below? int[] intMyArr = {11, 3, 5, 9, 4};
If a is an array of 5 integers then which of the following is the correct way to increase its size to 10 elements?
Which one of the following statements is correct?
Which of the following statements are correct about the C#.NET code snippet given below? int[] a = {11, 3, 5, 9, 4}; The array elements are created on the stack. Refernce a is created on the stack. The array elements are created on the heap. On declaring the array a new array class is created which is derived from System.Array Class. Whether the array elements are stored in the stack or heap depends upon the size of the array.
Which of the following is the correct output of the C#.NET code snippet given below? int[][] a = new int[2][]; a[0] = new int[4]{6, 1, 4, 3}; a[1] = new int[3]{9, 2, 7}; Console.WriteLine(a[1].GetUpperBound(0));
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments