Search Placementyogi.com
 

C# Arrays - Basic Objective Questions

1

Which one of the following statements is correct about arrays in C#?

A.

Array elements can be declared as integer type only.

B.

The rank of an Array is the total number of elements it can contain.

C.

The length of an Array is the number of dimensions in the Array.

D.

The Array elements are always stored in ascending or descending order.

E.

The default value of numeric type array elements is zero.

See Answer & Explanation Lets Discuss
Correct answer is : E
Explanation

No explanation available. Let's Discuss

 
2

Which of the following option is the correct way to define and initialise an array of 3 integers? (Multiple Choice)

A.
int[] p = {10, 20, 30};
B.
int[] p;
p = new int{10, 20, 30};
C.
int[] p;
p = new int[3]{10, 20, 30};
D.
int[] p;
p = new int[2];
p[0] = 10;
p[1] = 20;
p[2] = 30;
E.
int[] p;
p = new int[3];
p[0] = 25;
p[1] = 30;
p[2] = 40;
See Answer & Explanation Lets Discuss
Correct answer is : A,C,E
Explanation

No explanation available. Let's Discuss

 
3

The following code part is used to declare two-dimensional array myArray.

int[][]myArray = new int[2][];
myArray[0] = new int[3]{1, 2 ,3};
myArray[1] = new int[2]{4, 5};
A. True
B. False
See Answer & Explanation Lets Discuss
Correct answer is : A
Explanation

No explanation available. Let's Discuss

 
4

Which of the following option is correct to obtain the number of elements present in the array given below? (Multiple Choice)

int[] myArray = {10, 20, 30, 40, 50}
A.

myArr.GetMax

B.

myArr.Highest

C.

myArr.Length

D.

myArr.GetUpperBound(0) + 1

E.

myArr.GetMaxElements(0)

See Answer & Explanation Lets Discuss
Correct answer is : C,D
Explanation

No explanation available. Let's Discuss

 
5

The following code part is used to increase the size of an array myArray from 6 elements to 12 elements.

int[] myArray = new int[6]; 
myArray = new int[12];
A. True
B. False
See Answer & Explanation Lets Discuss
Correct answer is : A
Explanation

No explanation available. Let's Discuss

 
 

Banner to LogicGuns.com

Hide Page Information

C# Arrays - Basic Objective Questions and Answers with Explanation

Here you can find basic level C# arrays interview questions with answers and explanation.

Why Arrays in C#?

In this section you can learn and practice different types of basic level questions with answers on arrays to improve your skills in order to face the interviews, competitive examinations and various entrance tests (CAT, GATE, GRE, MAT, Bank Exam etc.) with full confidence.

Where can I get C# Arrays Basic Questions and Answers with Explanation?

PlacementYogi provides you lots of fully solved basic level arrays questions and answers with explanation. Fully solved examples with detailed answer description, explanation are given and it would be easy to understand. All students, freshers can download Operators quiz questions with answers as PDF files and eBooks.

Where can I get Basic Level C# Arrays Interview Questions and Answers (objective type, multiple choice)?

Here you can find objective type basic arrays questions and answers for interview and entrance examination. Multiple choice and TRUE or FALSE type and YES or NO type questions are also provided.