I want to get the random number between 1 and 0. However, I\'m getting 0 every single time. Can someone explain me the reason why I and getting 0 all the time? This is the
You are getting zero because Random.Next(a,b) returns number in range [a, b), which is greater than or equal to a, and less than b.
Random.Next(a,b)
If you want to get one of the {0, 1}, you should use:
var random = new Random(); var test = random.Next(0, 2);