H8 arrays - Opwarmen - 2 dimensionale array declareren

Sign in to test your solution.
using System; namespace oefening { public class Program { public static void Main(string[] args) { //schrijf hieronder jouw code double[,] array = new double[3, 4]; Random random = new Random(); for (int i = 0; i < array.GetLength(0); i++) { for (int j = 0; j < array.GetLength(1); j++) { array[i, j] = random.NextDouble(); } } //==================== //hieronder niets aanpassen //==================== Console.WriteLine(PrintArray(array)); } //==================== //hieronder niets aanpassen //==================== public static string PrintArray(double[,] array) { //print the array in rows and columns string result = ""; for (int i = 0; i < array.GetLength(0); i++) { result += "["; for (int j = 0; j < array.GetLength(1); j++) { result += array[i, j] + " "; } result += "]\n"; } return result; } } }
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.