Support Forums

Full Version: [C#] Random Integers [Beginner]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For beginners only, if you're intermediate I suggest you press the back button.

Imports:
Code:
None

Code:
Code:
static int RandomInteger()
        {
            Random integer = new Random();
            return integer.Next(); //Random High Number
            //return integer.Next(500); //Random number 0-500
            //return integer.Next(50, 500); //Random number 50 - 500
        }

Usage:
Code:
Console.WriteLine(Convert.ToString(RandomInteger());