**What is an Array?**

An array is a collection of items of same data type stored at memory location. Reason behind this is to store the data of same type. We write it as: using data type array_name[]={value}.

We can put the value of data in square bracket with array_name and can store only hat much data in curly brackets. If we give data type integer can all values will be of data type integer. The index number starts from 0. Suppose if we write size 3 then index number for first value is 0. So, total 4 values will be stored.

**For Example:** int arr[3]={22,23,24,25}. // for integer

**For Example:** float arr1[4]={2.3,1.4,5.6,3.8,5.9}

**There are two types:**

- One dimensional array
- Multi-dimensional array

**One-dimensional array: **In this type, there is only one dimension. That can be either column or row.

**For Example:** int A[3]={0,1,2,3}; // one dimension

**Multi-dimensional array:** In this type, there are multi-dimension. Example of multi-dimensions are 2D, 3D, 4D ,etc. In this type, there are rows as well as columns. We can solve matrices. In this, when writing size, the size of row is written first then size of column.

**For Example**: int B[2][3]; // 2D array where [2] is size of row and [3] is size of column

**For Example**: int C[2][2][2]={{2,3},{3,4}},{{5,6},{7,8}}; // three dimension

**Example using one dimensioal array**:

int main()

{ int arr[5];

arr[0]=10; arr[1]=20; arr[2]=30; arr[3]=40; arr[4]=50;

for(int i=0;i<=5;i++)

{

printf(arr[i]);

}

** output:** 10 20 30 40 50

**Use of array in real life:**

- For post office boxes;
- book pages;
- egg cartons;
- chess or checkerboard.
- use to implement mathematical vectors and matrices

**Advantages**:

Easy to access due to index number.

The search process can be easily applied.

2D array represents matrices.