Returns the Remainder from Two Numbers
THE CHALLENGE
Create a function that takes a number as its only argument and returns true if it's less than or equal to zero, otherwise return false.
Please notice that I use print in the code instead of console.log to show the result in my built-in console below. However, you should use console.log to
show the result in your normal console
THE CODE
// week 4, day 2, challange 2
// Return the Remainder from Two Numbers
function remainder(x, y) {
let remainder = x % y;
print("The remainder of dividing " + x + " by " + y + " is " + remainder);
// to show the result on your console use
// console.log("The remainder of dividing " + x + " by " + y + " is " + remainder);
};
remainder(1, 3);
remainder(3, 4);
remainder(-9, 45);
remainder(5, 5);
THE EXECUTION RESULT