an array is collection of similar data elements these data elements have the same data type the elements of the array are stored in consecutive memory locations and are referenced by an index (also known as the subscriptthe subscript is an ordinal number which is used to identify an element of the array marks marks marks marks marks marks marks marks marks marks marks marks marks marks marks marks marks marks marks marks figure twenty variables for students declaration of arrays we have already seen that every variable must be declared before it is used the same concept holds true for array variables an array must be declared before being used declaring an array means specifying the followingdata type--the kind of values it can storefor exampleintcharfloatdouble name--to identify the array size--the maximum number of values that the array can hold arrays are declared using the following syntaxtype name[size]the type can be either intfloatdoublecharor any other valid data type the number within brackets indicates the size of the arrayi the maximum number of elements that can be stored in the array for exampleif we writeint marks[ ]then the statement declares marks to be an array containing elements in cthe array index starts from zero the first element will be stored in marks[ ]second element in marks[ ]and so on thereforethe last elementthat is the th elementwill be stored in marks[ note that written within square brackets are the subscripts in the memorythe array will be stored as shown in fig th st nd rd th th th th th th element element element element element element element element element element marks[ marks[ marks[ marks[ marks[ marks[ marks[ marks[ marks[ marks[ figure memory representation of an array of elements figure shows how different types of arrays are declared