3. There are three types of array which are as
follows:
One dimensional array(or Linear array)
Two dimensional array(or Matrix)
Multi dimensional array
TYPES OF ARRAY
4. It is a linear collection of elements of same data type.
Declaration:-It declare as follows
o Syntax :data-type array-name[size]
o Example: int x[5]
Memory Allocation
ONE DIMENSIONAL
ARRAY
x[0] X[1] X[2] X[3] X[4]
5. It is the collection of elements of same data type in the form
of matrix.
Declaration:- Two dimensional array is declare as
follows
o Syntax :data-type array-name[row][column]
o Example: int a[3][3]
Memory Allocation
TWO DIMENSIONAL
ARRAY
a[0][0]
a[1][0]
a[2][0]
a[0][1] a[0][2]
a[1][1] a[1][2]
a[2][1] a[2][2]
6. It is a multi dimensional collection of element of same data type
Declaration :- Multi dimensional array is declare
as follows
o Syntax: data-type array-name[index1][index2]_ _
_ _ _ _[index n]
o Example:int p[3][3][3]
MULTI DIMENSIONAL
ARRAY