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