An array is a collection of elements of the same data type, stored in contiguous memory
locations and accessed using an index. Arrays help to store and manage multiple values
under a single variable name.
Features of Arrays
An array holds multiple values of the same data type.
The elements are stored in contiguous memory locations.
Each element can be accessed using its index number.
The first element index starts from 0.
Declaration of an Array
Arrays are declared by specifying the data type, array name, and size.
Example:
int marks[5];
This declares an integer array named marks with 5 elements.
Initialization of Arrays
Arrays can be initialized at the time of declaration or later.
Example:
int marks[5] = {10, 20, 30, 40, 50};