Random class is present under System Name space.
Random random = new Random();
int randomNumber = random.Next();// any random integer value
int anotherRandomNumber = random.Next(5, 100);// this will generate random number greater than 5 and less then 100.
int anotherRandomNumber1 = random.Next(100);// this will generate random number less then 100.
Random random = new Random();
int randomNumber = random.Next();// any random integer value
int anotherRandomNumber = random.Next(5, 100);// this will generate random number greater than 5 and less then 100.
int anotherRandomNumber1 = random.Next(100);// this will generate random number less then 100.
No comments:
Post a Comment