srand( (unsigned int) time(0));
for (int index = 0; index < size1; index++)
read[index] = (rand() % 30) + 1; // This will create 200 random number.
Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin. -- John von Neumann (1951)
Anyone who has not seen the above quotation in at least 100 places is probably not very old. -- D. V. Pryor (1993)
Myself, I like lagged-fibonacci sequences, salted with some really random variables such as the decay of some radioactive isotopes, the temperature at various locations on the earth, the current density of the solar wind impacting the earth, etc. FWIW, my wife is a particle physicist and uses Monte Carlo routines to model elemenatary physics. Really random number generators are essential in that work.
(Perhaps you could include at least your first name in your Profile, so we can address you with a proper name instead of your forum handle.)
Did you ever get your program working like you wanted?
Was your assignment to write the program, or did you just need the random numbers regardless of how you got them?
You might want to check out the Mersenne Twister algorithm; as far as I know, it is presently the best pseudo-random number generator available. It has an extremely long period (i.e. - generates MANY numbers before it starts to repeat.)
From their home page: "The randomness comes from atmospheric noise . . ."
Apparently, they have a few radio receivers, which they use to sample atmospheric noise and generate random numbers. Depending upon your needs, you can specify the types of random numbers you need, and this free web service will generate them for you.