Please help me with the task: First Array

Hello, I’m working on this task:

Create an array of 5 integers. Don’t fill the array with any values. Output the default values of every cell to the console, each on a new line.

Here is my code:


namespace Arrays
{
   class FirstArray
   {
       public static void Main(string[] args)
       {
       int[] myFirstArray = new int[5];
       Console.WriteLine(myFirstArray[myFirstArray]);
       }
   }
}

Can anyone please help me to solve it?

To output the value of each cell of an array you have to make a for-loop which outputs the value for the array at each index.

1 Like