I want to generate test cases for problems for a college contest, but when I am using rand() and srand() functions the numbers generated are small, I want to generate numbers of order of 10^9. How to do it?
You can use any online test-case generator. Personally, I would suggest you to use the SPOJ test case generator.
With this, you can easily generate large random numbers, arrays, strings and even graphs and trees.
Try it once!
What language? If C++11 or later have a look at random which provides several RNG engines and templated functions to get random numbers of different distributions.
You can use testlib.h. It provides nice functions for generating random numbers, strings etc.
I went through the same problem, you can use a bit-manipulation trick mentioned here to get large values