Explore topic-wise MCQs in Arrays .

This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Arrays knowledge and support exam preparation. Choose a topic below to get started.

1.

What will be the output of the C#.NET code snippet given below?

A. 0 0 34 34
B. 0 0 17 17
C. 0 0 0 0
D. 17 17 0 0
Answer» B. 0 0 17 17
2.

Which of the following is the correct way to obtain the number of elements present in the array given below?

A. 1, 2
B. 3, 4
C. 3, 5
D. 1, 5
Answer» C. 3, 5
3.

Which of the following is the correct way to define and initialise an array of 4 integers?

A. 1, 2
B. 3, 4
C. 1, 4, 5
D. 2, 4, 5
Answer» D. 2, 4, 5
4.

Which of the following statements is correct about the C#.NET code snippet given below?

A. intMyArr is a reference to an object of System.Array Class.
B. intMyArr is a reference to an object of a class that the compiler derives from System.Array Class.
C. intMyArr is a reference to an array of integers.
D. intMyArr is a reference to an object created on the stack.
Answer» C. intMyArr is a reference to an array of integers.
5.

Which of the following statements is correct about the array declaration given below?

A. intMyArr refers to a 2-D jagged array containing 2 rows.
B. intMyArr refers to a 2-D jagged array containing 3 rows.
C. intMyArr refers to a 3-D jagged array containing 2 2-D jagged arrays.
D. intMyArr refers to a 3-D jagged array containing three 2-D jagged arrays.
Answer» D. intMyArr refers to a 3-D jagged array containing three 2-D jagged arrays.
6.

Which of the following are the correct ways to define an array of 2 rows and 3 columns?

A. 1, 2 , 3
B. 1, 3
C. 2, 3
D. 2, 4, 5
Answer» C. 2, 3
7.

Which of the following statements are correct about arrays used in C#.NET?

A. 1, 2
B. 1, 3, 5
C. 3, 4
D. 1, 2, 5
Answer» E.
8.

Which of the following is the correct output of the C#.NET code snippet given below?

A. 20
B. 4
C. 18
D. 10
Answer» D. 10
9.

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?

A. foreach (int j = 1; j < a(0).GetUpperBound; j++)
B. foreach (int j = 1; j < a.GetUpperBound (0); j++)
C. foreach (int j in a.Length)
D. foreach (int j in i)
Answer» E.
10.

Which of the following statements are correct about the C#.NET code snippet given below?

A. 1, 2
B. 2, 3
C. 2, 5
D. 1, 4
Answer» B. 2, 3