CodeLab Academy 📞 9936 6696
← List Scratch · Level 10: Algorithms Quiz · 50 points ← #996 #998 →

#997. Sum of digits

When the green flag is clicked, this script runs. What number will the cat say?
when green flag clicked
set [n v] to (18446)
set [s v] to (0)
repeat until <(n) = (0)>
change [s v] by ((n) mod (10))
set [n v] to ([floor v] of ((n) / (10)))
end
say (s)

💡 Not sure? Build it in Scratch and try it out.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!