Demonstration of predictability (always prints the same thing) : Random : Development C# Examples


C# Examples » Development » Random »

 

Demonstration of predictability (always prints the same thing)









    
using  System;
using  System.Collections.Generic;
using  System.Globalization;
using  System.IO;
using  System.Text;


public  class  MainClass
{
        public  static  void  Main()
        {
                Random  r2  =  new  Random(99830123);
                Console.WriteLine(r2.Next());
                Console.WriteLine(r2.Next(150000));
                Console.WriteLine(r2.Next(9999,  100750));
                Console.WriteLine(r2.NextDouble());
        }
}
    
   
  
   



Output

214873035
75274
85587
0.571986661558965


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» Random