Generate a random number for captcha

Saratvaddilli
Posted by Saratvaddilli under C# category on | Points: 40 | Views : 1261
using System; 

class Program
{
private Random random = new Random();

private int RandomNumber (int min, int max)
{
return random.Next (min, max);
}

public static void Main(string[] args)
{
Program program = new Program();
for (int i = 0; i <= 10; i++)
{
Console.WriteLine (program.RandomNumber(1, 100));
}

Console.ReadKey(); // wait so you have time to see the output
}
}

Comments or Responses

Login to post response