Challenge 4: Check If a Number Is Divisible by Another
Implement a function named
isDivisible that receives two parameters (named
y) and only returns true if “x” can be divided by “y”(and false otherwise).
A number is divisible by another when the remainder of the division is zero. Use the modulo operator ("%").
Two numbers x and y
Returns true if x is divisible by y and false otherwise
x = 4, y = 2
Write your code below. It is recommended that you try solving the exercise yourself before viewing the solution.