C# LOOPS & ARRAYSChapter 2 · C# Loops & Arrays
Fixed-size arrays
An array stores multiple elements of the same type in a single variable. Its size is fixed when created. Access elements using zero-based indices.
Worked example
string[] clouds = new string[] { "wispy", "puffy", "grey" };
Console.WriteLine(clouds.Length); // 3
Console.WriteLine(clouds[0]); // wispy
foreach (string cloud in clouds) {
Console.WriteLine(cloud);
}How it reads
- string[] declares a variable that holds an array of strings
- new string[] { ... } creates the array with starting values
- clouds.Length returns the number of items in the array

Cloud tip: Since arrays have a fixed size, you cannot add or remove elements after creation. If you need a dynamic size, use List<T>.


