warfareknow
BANNED

- Joined
- Apr 4, 2015
- Messages
- 463
- Reaction score
- -6
- Country
- Location
Hi, so if I want a random number between 0 and x in C
I can use this:
But how does this work between a range like 2 - 12?
I can use this:
Code:
srand(time(NULL))
int random = rand() % x +1;
But how does this work between a range like 2 - 12?