# rand function

rand will generate a random number between 0 and 'RAND_MAX' (at least 32767).

    Library:   stdlib.h

    Prototype: int rand(void);

    Syntax:	   int r;                 		/* Random number	*/

               r = rand();

## Notes

- Rand will always produce the same sequence of numbers unless srand is called to seed the start point.
- RAND_MAX is only defined in ANSII header files.
- A non standard function random is available on the Sun.

example program.

## See also:

  srand Seed the randon number generator.
  rand man page.

Top | Master Index | Keywords | Functions