R
Q. What is the correct definition of an array?
- Correct Answer - Option(B)
- Views: 152
- Filed under category C++
R
An array in programming (especially in C/C++, Java, etc.) is defined as:
A collection of elements of the same data type, stored in contiguous memory locations, and accessed using an index.
Example in C:
int arr[3] = {10, 20, 30};
❌ Option A is incorrect:
Non-contiguous memory would imply a linked list, not an array.
✅ Correct Answer: (B)
You must be Logged in to update hint/solution
Discusssion
Login to discuss.