C code to generate random numbers


///  Constructed random number   seeds
static int GetRandomSeed()
{
      byte[] bytes = new byte[4];
      System.Security.Cryptography.RNGCryptoServiceProvider rng = new System.Security.Cryptography.RNGCryptoServiceProvider();
      rng.GetBytes(bytes);
      return BitConverter.ToInt32(bytes, 0);
}

///  Generate random   The number
static int rnd()
{

      Random ran = new Random(GetRandomSeed());
      int cnt = ran.Next(0,59);
      return cnt;
 }

That’s the end of this article, I hope you enjoy it and it will be helpful for you to learn C#.