A

Admin • 833.24K Points
Coach

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.
  • Correct Answer - Option(B)
  • Views: 36
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

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. ✅

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.