Generate a random int in a given range

suggest change

Next(minValue, maxValue) returns an int from minValue inclusive to maxValue exclusive. The call below returns 10 through 19.

Random rnd = new Random();
var from10Through19 = rnd.Next(10, 20);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents