Challenge: Array Declaration
Create an empty array called heights
of type float
and length (size) of 7
.
main.cs
12345678910111213using 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
12345678910111213using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line float[] heights = new float[7]; } } }
Var alt klart?
Tak for dine kommentarer!
Sektion 5. Kapitel 2
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Suggested prompts:
Can you show me the code to create the `heights` array?
What does the array look like after initialization?
Can I use a different data type for the array?
Awesome!
Completion rate improved to 1.59
Challenge: Array Declaration
Stryg for at vise menuen
Create an empty array called heights
of type float
and length (size) of 7
.
main.cs
12345678910111213using 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
12345678910111213using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line float[] heights = new float[7]; } } }
Var alt klart?
Tak for dine kommentarer!
Sektion 5. Kapitel 2