Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I know I can get a random number for example from 0 to 700 using:
arc4random() % 362
But how can I get a random number in between for example 200 to 300?
(arc4random() % 100) + 200
Add a comment
Not to be picky, but I am pretty sure you have to add a number... if you want all the numbers from 200 to and including 300... use
200 + arc4random()%101;
arc4random()%100 would give a random number from 0 to 99 so 300 would never occur...
arc4random()%100
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.