random numbers
HEY!!um..... how would I go about getting a random number..between two different numbers..... say I wanted a random number between 5 and 17
how would i code that?
int x =rand()% ???????
HELP...plz
thank you
BAHcows go moomoos go cow
int lowNum = 5;int highNum = 17;int numDiff = highNum - lowNum;int r = rand()%numDiff;r = r + lowNum;
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement