I would like to know how to get different random numbers within a range from 1 to 6, to include both numbers 1 and 6.
I have used this code:
n = rand() % 6 + 1;
but I end up with the same number .
How do I get to give me different numbers and not the same number consecutively ?
I have used this code:
n = rand() % 6 + 1;
but I end up with the same number .
How do I get to give me different numbers and not the same number consecutively ?
Comment