Search code examples
iosobjective-crandomarc4random

iOS Random Numbers in a range


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?


Solution

  • (arc4random() % 100) + 200