Or a brute force approach would be something like this :
int total;//this holds the number of random numbers to be generated
//Assume you want to generate random numbers between 50 and 70
int cnt=0;//This hold the number of random numbers already generated.
//Generate the random number between 1 and 70 say number is rnum
//generate rnum again