I need a code to generate only random EVEN numbers 2-100
There is tutorials on the web that generate random numbers but they're odd and even.
Please understand i just need even numbers to generate.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- back button text does not change
- Finding k smallest elements in a min heap - worst-
- binary search tree path list
相关文章
- 现在使用swift开发ios应用好还是swift?
- What are the problems associated to Best First Sea
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Coin change DP solution to keep track of coins
- why 48 bit seed in util Random class?
- How can I add media attachments to my push notific
1, generate numbers 1-50
2, multiply all the numbers by 2
all numbers multiplied by 2 are even
This will work:
arc4random_uniform(50)
will give results in the range 0 - 49. Adding 1 gives a value in the range 1 - 50. Multiplying by two gives you even numbers in the range 2 - 100.