#Quick question, how do we check if a number ends with 1 or 3?

6 messages · Page 1 of 1 (latest)

eager horizon
#

no code, just a logic question

hardy hearthBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

hybrid solstice
#

Modulo helps with extracting digits, then you just check.

eager horizon
#

hmm, yes, I had the same idea but I don't really know what to check maybe if num(the var)% 10 == 1{
run code
}
?

hybrid solstice
#

Pretty much

eager horizon
#

sounds good, thx man