#538. Remainder (mod)
When the green flag is clicked, this script runs. What number will the cat say?
when green flag clicked say ((167) mod (8))
# When the green flag is clicked print(167 % 8)
// 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(167, 8));
💡 Not sure? Build it in Scratch and try it out.