C# make an array with random numbers code example
Example 1: random value in array c#
Random random = new Random();
int value = random.Next(0, array.Length);
Console.Write(array[value]);
Example 2: generate random number c#
Random rnd = new Random();
int month = rnd.Next(1, 13); // creates a number between 1 and 12
int dice = rnd.Next(1, 7); // creates a number between 1 and 6
int card = rnd.Next(52); // creates a number between 0 and 51