// Test Random class. static void Main(string[] args) { // Create Random object. Choose a key based // on the computer's time of day clock. Random r = new Random(); // Create Random object, specifying the seed // explicitly. Random s = new Random(28347463); // Test the Next and NextDouble methods for r. // We need to call these methods several times // to see if the returned random numbers are in // the correct ranges. for (int i = 1; i <= 20; i++) { Console.WriteLine(r.Next(3, 8) + " " + r.Next(4) + " " + r.NextDouble()); } // Test the Next and NextDouble methods for r. for (int i = 1; i <= 20; i++) { Console.WriteLine(r.Next(3, 8) + " " + r.Next(4) + " " + r.NextDouble()); } Console.ReadLine(); }