Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Arrays

Which of the following statements are correct about 6 used in the program?int num[6];num[6]=21;

Question: Which of the following statements are correct about 6 used in the program?int num[6];num[6]=21;
[A].

In the first statement 6 specifies a particular element, whereas in the second statement it specifies a type.

[B].

In the first statement 6 specifies a array size, whereas in the second statement it specifies a particular element of array.

[C].

In the first statement 6 specifies a particular element, whereas in the second statement it specifies a array size.

[D].

In both the statement 6 specifies array size.

Answer: Option B

Explanation:

The statement ‘B’ is correct, because int num[6]; specifies the size of array and num[6]=21; designates the particular element(7th element) of the array.

Which of the following statements are correct about 6 used in the program?int num[6];num[6]=21; Read More »

Arrays, C Programming

Which of the following statements are correct about an array?

Question: Which of the following statements are correct about an array?

[A].

1

[B].

1,4

[C].

2,3

[D].

2,4

Answer: Option B

Explanation:

1. The array int num[26]; can store 26 elements. This statement is true.

2. The expression num[1] designates the very first element in the array. This statement is false, because it designates the second element of the array.

3. It is necessary to initialize the array at the time of declaration. This statement is false.

4. The declaration num[SIZE] is allowed if SIZE is a macro. This statement is true, because the MACRO just replaces the symbol SIZE with given value.

Hence the statements ‘1’ and ‘4’ are correct statements.

Which of the following statements are correct about an array? Read More »

Arrays, C Programming

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

Question: 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: Option B

Explanation:

No answer description available for this question.

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

Arrays, C Sharp Programming