Generating Random Numbers..

I'm confused, I was under the impression that:

 
  rand() % (16+1) 


would generate random numbers between 1 to 16, yet for some reason it is generating 0's too. How could that be?
Ahh, scratch that. Apparently you can't put the numbers in parenthesis. Ha, who would of knew lol. Guess it was thinking I was saying rand() % 17 which would of made sense of why it was generating numbers from 0 to 17.
Topic archived. No new replies allowed.