c# random num code example
Example 1: c# random int
Random rnd = new Random();
int number = rnd.Next(1, 10);
Example 2: get random number c#
Random rnd = new Random();
int month = rnd.Next(1, 13);
int dice = rnd.Next(1, 7);
int card = rnd.Next(52);
Example 3: generate a random number in c#
Random rnd = new Random();
int value = rnd.Next(min,max);
Console.Write(value);
Example 4: c# random
Random rnd = new Random();
for (int ctr = 0; ctr < 10; ctr++) {
Console.Write("{0,3} ", rnd.Next(-10, 11));
}