Random numbers are created using the rand () function. The rand function has two parameters. They are the lowest number and the highest number possible of being generated. If you wanted to create a number between 1 and 100 you would use rand(1, 100);. If you do not specify a range, it will create a number between 0 and getrandmax(). On some platforms the default max is limited to 32768 and if you want a higher cap number you need to specify the range in the function.
Here are some simple fun scripts that practice using random numbers: