im absolutely new to development, and trying to learn swift.
Right now i know how to make random number, and my next step is:
Im trying to understand how to check if my random number (127) could be divided by 2 without decimals ?
I have no idea how to do it.
2
Answers
You can use operator
%
– remainder operatorexample:
There is a specific API isMultiple(of:) in Standard Library for this purpose