hey,
i will like you to try this for C, i use VC6 but the program is C++ and i get my random numbers anytime i want....
first include this
#include <cstdlib>
using std::rand;
after that.. whenever you want to generate the random numbers,
wil generate one of 0, 1, 2, 3;
now if you want the number to be in the range 1 to 4, just use the code
now you will get number in the range 1,2,3,4;
note 1 is the smallest and 4 is the largest;
if you want to generate the numbers 2, 4, 6, 8...
its by doing the same but adding 2 instead