One dimensional array.

A single dimensional array (also called one dimensional array) is a linear list consisting of related data items of same type . In memory all the data items are stored in contiguous memory locations one after the other.

Basic properties of arrays are:-


Initialization of single dimensional array.

1) Initializing all specified memory Location.
Array can be initialized at the time of declaration when their initial value are known in advance array elements can be initialized with data items of type integer , character , float etc .the value are copied into array in the order specified in the declaration.
        Example:- int arr[5]={ 5, 7, 8, 4, 3 };
2) Initialization without size
       Example:- int arr[ ]={4, 6, 2, 3 , 7};
3) Initialization with a string
       Example:- char arr[ ]=“computer”;
4) Assigning values to array.
      Example:-      int a[5];

W.A.P to enter 5 numbers and print the value.

void main()
   int arr[5], i;
   printf(“Enter element of array\n”);


Enter element of array.
6 7 3 4 10