how reliable is rand() ?

I want to make a statistic info gathering program, I want it to run millions (perhaps billions) of random scenario's
and record the percentages/averages, yes I know I could do it mathematically quite easily in most cases, but in other cases it's easier just to run a simulation (especially if you need a fair amount of data)

would rand() be good for this? or does rand() loop after a while? and if so, after how many digits?