Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdlib.h>
    int rand( void );

Description:
    The rand function computes a sequence of pseudo-random integers in the
    range 0 to  RAND_MAX (32767).  The sequence can be started at different
    values by calling the  srand function.

Returns:
    The rand function returns a pseudo-random integer.

Example:
    #include <stdio.h>
    #include <stdlib.h>

    void main()
      {
        int i;

        for( i=1; i < 10; ++i ) {
          printf( "%d\n", rand() );
        }
      }

Classification:
    ANSI

Systems:
    All, Netware

See Also:
    srand

See Also: srand

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson