0% found this document useful (0 votes)
2 views1 page

Understanding Arrays: Features & Examples

Uploaded by

sanjaikumar1707
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Understanding Arrays: Features & Examples

Uploaded by

sanjaikumar1707
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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};

You might also like