I think you meant to say "Can I double handle that value". If so, what do you mean by that exactly? The answer is probably yes.. what is the exact range you want?
the max number i want is 99999 and the lowest number is 10000.
While running the program it looks like it is stuck in an infinite loop.
One more thing i wanted to ask i want to change random generated after every miilisecond.
Im getting lost.
rand()%90000; //0 to 89999
now add 10000. range is 10000 to 99999.
answer is just
10000+ rand()%90000; //right?
% is bad about messing up the distribution of random numbers (and most rand() implementations are terrible to boot, sacrificing randomness for speed). Use the modern tools if this bothers you.
Yes that's true but RAND_MAX is only guaranteed to be 32767. So there are chances where we are never able to reach the 99999 limit we want. So we generate two numbers below that max and combine them to get the limit we want.
ah. assurances aside, I got
2147483647 for it on mine for rand max. /shrug. Is the OP actually on a severely limited compiler with a low value or are we theorycrafting?