Challenge: Array Declaration
Create an empty array called heights
of type float
and length (size) of 7
.
main
99
1
2
3
4
5
6
7
8
9
10
11
12
13
using System;
namespace ConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
// Declare an array below this line
___
}
}
}
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
99
1
2
3
4
5
6
7
8
9
10
11
12
13
using System;
namespace ConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
// Declare an array below this line
float[] heights = new float[7];
}
}
}
12345678910111213using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line float[] heights = new float[7]; } } }
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 5. Hoofdstuk 2
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.