Initialize Array Elements
Now that we have defined the array, we can start using it. The initial part is to store the elements in the array so that we can process them afterward.
Using the Assign statement, we can store an element with the array variable name and subscript.
In the Flowgorithm, the subscript number starts from 0. For an array of size n, the valid values of the subscript are from 0 to n-1. The array subscript cannot be outside this valid range. For example, if the array size is 10, we can use the valid range of the subscript from 0 to (10-1), i.e., 0 to 9.
A good subscript is a value that is within the valid range. For example, a good subscript for the above example is 0 to 9, both inclusive. A bad subscript is a value that falls outside this valid range.
The subscript is enclosed with square brackets. For example, we can use the index as 0 to store the first element.
arr[0] = 5