rand is one of the simpler functions.
it takes what value you enter and returns a random number between 0 and your value.
such as:
int a; a = rand(5);
you just made the integer a equal to a random number from 0 to 5.