To generate random number in the given range