Sorry, I know there are similar questions already posted but this book is confusing me nonetheless.
In "C Programming: Absolute Beginner's Guide", there is a line:
dice1 = (rand() % 5) + 1;
to generate a random number between 1 to 6 for a dice game.
Isn't this an error? From my understanding, you cannot get a remainder of 5 using % 5
so that line would only generate numbers from 1 to 5. I'm an absolute beginner so I can't tell if I'm making an error or the book is. Could someone confirm?