
7-5
Arrays
7.2 ARRAY INITIALIZATION
e array initialization can be done as under:
int a[5]={1,2,3,4,5};
Here, five elements are stored in an array ‘a’. List of
elements initialized is shown within the braces. The
array elements are stored sequentially in separate
locations. Then the question arises how to call in-
dividually to each element from this bunch of inte-
ger elements. Reading of the array elements begins
from ‘0’. By indicating the position of elements, one
can retrieve any element of an array. Array elements
are called with array names followed by the element
numbers. Table 7.1 explains the same.
Example:
To store more than one value the ...