Random rnd = new Random(); int randomInt = rnd.Next(1, 11); Console.WriteLine($"Random number between 1 and 10: {randomInt}");
Random rnd = new Random(); double randomDouble = rnd.NextDouble(); Console.WriteLine($"Random double between 0 and 1: {randomDouble}");
Random rnd = new Random(); Color randomColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256)); Console.WriteLine($"Random color: {randomColor}");Overall, C# System Random is a useful tool for generating random numbers and values in a variety of scenarios.