C# Snippet: Random Number

Here is a useful snippet to generate a six digit random number in C#

    // Generate a 6 digit random number
    Random r = new Random()
    randomNumber = r.Next(100000,999999);
    Console.WriteLine("Your random number is: {0}", randomNumber);
    // end

Originally posted in /bloggarriv.

Leave a Comment