Hey all,

Im trying to produce random numbers in the range of 1 to 50,000 using the rand() function.

just a little curiouse as to how this function works.

Ive been fiddling with it and i havent learnt much. Im guessing the seed you enter should influence the numbers generated, but ive been entering in new seeds to find that the numbers generated are exactly the same. This could have something to do with the complexity of my seeds however..

i tried numbrs like 7, 50.. then randomly mashing the number pad. but it didnt work.

if i don't use a seed but a formulae such as:

i = 1+(int) (10.0 * rand()/(RAND_MAX + 1.0))

it will generate what seems to be random but each time it is called.. each time the program is run the pattern is exactly the same.

I tried entering a seed into the rand function here but it didnt seems to make any difference.

Also one last thing. This formula is supposed to generate numbers betweek 1 and 10. but it doesnt.

thanks,