Methods of the Random class

Use the following methods of the Random class to generate random numbers.

  • Next() Returns a positive random integer within the default range -2,147,483,648 to 2,147,483, 647.
  • Next(int) Returns a positive random integer that is less than the specified maximum value.
  • Next(int, int) Returns a positive random integer within the specified minimum and maximum range (includes min and excludes max).
  • NextDouble() Generates random floating-point number that is greater than or equal to 0.0 and less than 1.0.
  • NextByte() Fills the specified array with the random bytes.

Source: Generate Random Numbers in C# (tutorialsteacher.com)

Comments