About Lesson
ARRAYS
An array is a collection of similar datatype that are used to allocate memory in a sequential manner.
Or
Array is a collection or group of elements (data). All the elements of array are homogeneous (similar). It has contiguous memory location.
Syntax :
<data type> <array name>[<size of an array>]
Declaration of an Array
data-type variable-name[size/length of array];
Example
int age[5]={22,25,30,32,35};
int marks[4]={ 67, 87, 56, 77 }; //integer array initialization
float area[5]={ 23.4, 6.8, 5.5 }; //float array initialization
int marks[4]={ 67, 87, 56, 77, 59 }; //Compile time error
Practical Exercise:- Click Here