Arrays

In the C# programming language, arrays are one of the basic data types that allow you to store collections of elements of the same type.
Line 1, Char 1

Declaring an array

Declaration is the process of creating a variable, defining its type and name.
Line 1, Char 1

Initialization

Initialization is the process of assigning an initial value to a variable.
Line 1, Char 1

Reading array elements

Array elements are accessed by index, starting from 0.
Line 1, Char 1

Changing array elements

Line 1, Char 1

Exercises

  1. Create and print an array of three movies you recently watched.
Line 1, Char 1
  1. Replace the last movie in this array with your favorite one and print the modified array.
Line 1, Char 1
  1. Create and print an array of seasons: winter, spring, summer, autumn.
Line 1, Char 1
  1. What is your favorite season? Change that array element, for example: summer is my favorite season. Print the modified array.
Line 1, Char 1