I observed that rand() library function when it is called just once within a loop, it almost always produces positive numbers.
rand()
for (i = 0; i <
rand() is defined to return an integer between 0 and RAND_MAX.
0
RAND_MAX
rand() + rand()
could overflow. What you observe is likely a result of undefined behaviour caused by integer overflow.