C and C++ Tutorial: Generating a random number in C++ is easy, but for generating one within a range you must use a little trick.