answersLogoWhite

0

RAND: Rand uses a multiplicative congruential random number generator with period232 to return successive pseudo-random numbers in the range 0 to RAND_MAX.

Return Value: Rand returns the generated pseudo-random number. RANDOM(): Random returns a random number between 0 and (num-1).random(num) is a macro defined in STDLIB.H.

RANDOMIZE(): Randomize initializes the random number generator with a random value. Because randomize is implemented as a macro that calls the time function prototyped in TIME.H, you should include TIME.H when you use this routine

SRAND(): The random number generator is reinitialized by calling srand with an argument value of 1.The generator can be set to a new starting point by calling srand with a given seed number.

User Avatar

Wiki User

17y ago

Still curious? Ask our experts.

Chat with our AI personalities

FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
ReneRene
Change my mind. I dare you.
Chat with Rene

Add your answer:

Earn +20 pts
Q: What is the difference between the functions rand random srand and randomize?
Write your answer...
Submit
Still have questions?
magnify glass
imp