One common way of choosing a random number in [0, n) is to take the result of rand() modulo n: rand() % n. However, even if the r
That depends on:
Let us assume your RAND_MAX is 2^32. If N is rather small (let's say 2) then the bias is 1 / 2^31 -- or too small to notice.
But if N is quite a bit larger, say 2^20, then the bias is 1 / 2^12, or about 1 in 4096. A lot bigger, but still pretty small.