An array in C# is a type that contains a list of items of the same type. Elements in the list can be referenced by a single variable name and a numerical index. The first element is accessed using an index value of 0.
For example, below we define a four element array of integer (int) and set its elements to some hard-coded values.
1
2
3
4
5
6
7
| int[] numbers = new int[4]; // Declare/create 4-element array of int// Set 4 elements to integer valuesnumbers[0] = 10; // 1st elementnumbers[1] = 20;numbers[2] = 30;numbers[3] = 40; |

