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

book
Challenge: Array Declaration

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

main.cs

main.cs

copy
using System;

namespace ConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
// Declare an array below this line
___
}
}
}
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
using System;

namespace ConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
// Declare an array below this line
float[] heights = new float[7];
}
}
}
12345678910111213
using 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?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 5. Kapitel 2

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

We use cookies to make your experience better!
some-alt