Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Array Declaration | Arrays
C# Basics

bookChallenge: Array Declaration

Create an empty array called heights of type float and length (size) of 7.

main.cs

main.cs

copy
12345678910111213
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line ___ } } }

The syntax of declaring an empty array is datatype[] arrayName = new datatype[size];.

main.cs

main.cs

copy
12345678910111213
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line float[] heights = new float[7]; } } }

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 5. ChapterΒ 2

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

bookChallenge: Array Declaration

Create an empty array called heights of type float and length (size) of 7.

main.cs

main.cs

copy
12345678910111213
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line ___ } } }

The syntax of declaring an empty array is datatype[] arrayName = new datatype[size];.

main.cs

main.cs

copy
12345678910111213
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line float[] heights = new float[7]; } } }

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 5. ChapterΒ 2
some-alt