C# Snippet: Random Number

Here is a useful snippet to generate a six digit random number in C#
[code]
// Generate a 6 digit random number
Random r = new Random()
randomNumber = r.Next(100000,999999);
Console.WriteLine(“Your random number is: {0}”, randomNumber);
// end
[/code]

Originally posted in /bloggarriv.

Leave a Reply

Your email address will not be published. Required fields are marked *