📚 C# Arrays - Interactive Lesson

An array is a data structure that can hold multiple values of the same type in a single variable. Arrays are used to store a collection of data that can be accessed by index.

📂 Declaring and Initializing an Array

🔑 Pro Tip: Arrays in C# start at index 0. So, numbers[0] refers to the first element.

📝 Accessing Elements of an Array

🔧 Try It Yourself: Update Array Values






[0, 0, 0, 0, 0]

🧠 Quiz: Test Your Knowledge

1. What is the index of the first element in an array?




2. How do you access the third element of an array called arr?




3. What does this code do?




4. How would you declare an array of strings in C#?




5. Which property gets the length of an array?




Quiz results will appear here...
💡 Remember: Array indices always start from 0 in C#. The last index is Length - 1.