Divisibility Rule for 15

Oct 2019
9
0
UAE
Hello,

To be divisible by 15 a number has to be divisible by 3 and by 5. Can we directly check number divisible for 15?

For example: Are these equal?

number = 105

(number % 15 == 0) instead of check (number % 5 == 0 && number % 3 == 0)

Thanks
 
Oct 2018
129
96
USA
A bit of an aside, but a number is divisible by 15 if the digits of the number add up to a multiple of 3 and the last digit is a 5 or a 0. Thought that was pretty neat.
 
  • Like
Reactions: topsquark