What is arrays :
An array is collection of elements where all the elements are same data type and under the same name.
Types of arrays are
An array is collection of elements where all the elements are same data type and under the same name.
Types of arrays are
- One -dimensional array
- Two dimensional array
- Multi dimensional array
- One -dimensional array : It is an array in which each element is accessed by using only subscript. The only one subscript represents the positions of the elements in the array.
Syntax datatype array- name [size];
Example: into marks [50]
2. Two dimensional array: It is an array in which each element is accessed by using 2- subscripts represents the positions of the elements in the array.
Declaration of two- dimensional array :
Syntax datatype array- name [row -size ] [ column- size];
Example: int a[2][3];
3.Multi dimensional array: A multidimensional array is an array of n - dimensions .
2. Two dimensional array: It is an array in which each element is accessed by using 2- subscripts represents the positions of the elements in the array.
Declaration of two- dimensional array :
Syntax datatype array- name [row -size ] [ column- size];
Example: int a[2][3];
3.Multi dimensional array: A multidimensional array is an array of n - dimensions .