Example, If the user want to store marks of 100
students, User may create 100 variables to store
data !!!
INTRODUCTION
An array is a sequence of data item of
homogeneous value(same type).
Each block of array is stored consecutively in
memory.
Huge amount of data can be stored under
single variable name.
Searching of data item is faster.
ARRAY DECLARATION
Syntax:
Data type arrayName [ arraySize ];
Examples:
int list[10];
char num[15];
float hat[20];
ARRAY INITIALIZATION
Example:
int num[10];
num[0]references the first element in the array.
num[9]references the last element in the array.
int num[6]={2,4,6,7,8,12};
Individual elements can also be initialize as: