If rand() generates equi-probable numbers within range [1 - n] and n is a multiple of 1000 then your above code will be correct.
You should utilize the bit-generator function. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
