SyntaxFix
Write A Post
Hire A Developer
Questions
You can use the % operator to find the remainder of a division, and compare the result with 0.
%
0
Example:
if (number % divisor == 0) { //code for perfect divisor } else { //the number doesn't divide perfectly by divisor }