What is Numeric Array?
Numeric arrays allow us to store numerous values of the same data type in a single variable rather than creating multiple variables for each value. These values can then be accessed using an index, which is always a number in numeric arrays.
![](https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-34.png)
How to declare and initialize an array?
There are two ways to create an array. Let’s take a look at both these ways in the Following example:
1. Accessing the elements
You must know the index value of an array’s items in order to access them.
![](https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-33.png)
Example:-
2. Length of an array
The in-built function count
can be used to count the length of an array, or the number of elements in the array.
![](https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-35.png)
Example:-