Q. What is an array?

  • (A) an array is a collection of variables that are of the dissimilar data type.
  • (B) an array is a collection of variables that are of the same data type.
  • (C) an array is not a collection of variables that are of the same data type.
  • (D) none of the above.
πŸ’¬ Discuss
βœ… Correct Answer: (B) an array is a collection of variables that are of the same data type.
Explanation:

In C language, an array is:

A collection of elements (variables), all of the same data type, stored in contiguous memory locations, and accessed using an index.

Example:

int numbers[5] = {1, 2, 3, 4, 5};
  • This is an array of 5 integers.
  • All elements are of type int.
  • Indexed from 0 to 4.

Evaluating the Options:

OptionExplanationCorrect?
(A) Collection of dissimilar data types❌ Incorrect – that would describe a structure (struct) 
(B) Collection of same data typeβœ… Correct 
(C) Not a collection of same data type❌ Incorrect 
(D) None of the above❌ Incorrect 

Final Answer: (B) An array is a collection of variables that are of the same data type. βœ…

Explanation by: Mr. Dubey

In C language, an array is:

A collection of elements (variables), all of the same data type, stored in contiguous memory locations, and accessed using an index.

Example:

int numbers[5] = {1, 2, 3, 4, 5};
  • This is an array of 5 integers.
  • All elements are of type int.
  • Indexed from 0 to 4.

Evaluating the Options:

OptionExplanationCorrect?
(A) Collection of dissimilar data types❌ Incorrect – that would describe a structure (struct) 
(B) Collection of same data typeβœ… Correct 
(C) Not a collection of same data type❌ Incorrect 
(D) None of the above❌ Incorrect 

Final Answer: (B) An array is a collection of variables that are of the same data type. βœ…

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
221
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
86%
Success Rate