Generates a random number inside a user defined range.