Utility Functions and C Language Reference > C Language Reference > Alphabetical List of Functions > rand

rand

Example: rand Mathematics Functions

Gets a random integer between 0 and 32767.

int rand( void ); 

Before invoking rand, call srand to seed the pseudo-random number generator.

Return Values

Returns a pseudo-random integer in the range 0 to 32767.