For instance, the following gives you a random number between [0-10].
srand(time(NULL));
int r = ( rand() % 10 ) + 1;
I want to make it something like (0-10]
, i.e. excluding zero but including 10. I may use if condition here but I want more neat solution.
Thank you