how to tell if two numbers are multiples of each other binary code example
Example: algorithm that prints if one of the numbers is multiple of the other
You can simply use % Modulus operator to check divisibility.
For example: n % 2 == 0 means n is exactly divisible by 2 and n % 2 != 0 means n is not exactly divisible by 2.