#504. Remainder (mod)
When the green flag is clicked, this script runs. What number will the cat say?
when green flag clicked say ((162) mod (6))
# When the green flag is clicked print(162 % 6)
// Scratch's mod gives a positive remainder even for negative numbers
function mod(a, b) {
return ((a % b) + b) % b;
}
// When the green flag is clicked
console.log(mod(162, 6));
💡 Not sure? Build it in Scratch and try it out.