rand is one of the simpler functions. It takes what value you enter and returns a random number between 0 and your value.
Example:
int a; a = rand(5);
The function returns a value that is equal to a random number from 0 to 5.