I'm not going to do your homework for you, but I'll give you a few starting points.
- srand(), to initialize the random number generator. This is usually done with the program's execution time or something similar.
- rand(), to get one random number after the generator has been initialized.
- RAND_MAX, which is the maximum number that can be returned by
rand
. You can use this to manipulate your output so it falls within the proper range.