I want to create 2d array in C#. size: 3 on 5, and insert into random numbers. I try that but it\'s not work:
Random rnd = new Random(); int[][]
Here it is:
Random rnd = new Random(); int[,] lala = new int[3,5]; for(int i=0;i<3;i++) { for(int j=0;j<5;j++) { lala[i, j]= rnd.Next(1, 10); Console.WriteLine("[{0}, {1}] = {2}", i, j, lala[i,j]); } }
working sample: http://dotnetfiddle.net/4Fx9dL