Array in C

Array: An array is a collective name given to a group of similar quantities. If we would like to store 100 employee salary then we will should create an array of size 100 (int salary) These similar elements could be all integers or all floats or all characters etc.

In this video I have explained about Array in C:

1. Explain Array & its need.

2. Code for entering & gettting value from Array in C.

3. Type of Array.

a. Single Dimenstion Array.

b. Multi Dimenstion Array.

Secondly I have shown code explaining how you can entering & gettting value from Array in C.

``` /* Developed By:Prof. Vinod Pillai vinodthebest@gmail.com Array in C. */```

``` #include int main() { //Single Dimenstion Array int array; int i,j,rel=0; //Multi Dimenstion Array 3 Rows & 5 Coloums each int arr; printf("\n Enter the Value of Array:"); scanf("%d",&array); printf("\n The result is :%d",array); //Getting the Value for(i=0;i<5;i++) { printf("\n Enter the Value of Array:"); scanf("%d",&array[i]); } //Printing the Value for(i=0;i<5;i++) { printf("\n The result is :%d",array[i]); rel=rel+array[i]; } printf("\nThe sum of Array values is:%d",rel); //*************************************************************** rel=0; //Two Dimenstion Array Getting the Value for(i=0;i<3;i++) { for(j=0;j<5;j++) { printf("\n Enter the Value of Array:"); scanf("%d",&arr[i][j]); } } //Printing the Value for(i=0;i<3;i++) { for(j=0;j<5;j++) { printf("\n The result is :%d",arr[i][j]); rel=rel+arr[i][j]; } } ```

``` printf("\n\nThe sum of Array values is:%d",rel); return 0; } ```