Array Example

The elements in an array can be stored and accessed by using the index of the array.


Example:

Dim n(10) As Integer       ' n is an array of 11 integers '

Dim i, j As Integer      

For i = 0 To 10

n(i) = i + 100         ' set element at location i to i + 100 

Next i

      

For j = 0 To 10

Console.WriteLine("Element({0}) = {1}", j, n(j))

Next j



Last modified: Thursday, 11 July 2019, 11:59 AM