If number ends with 1 do something
Just check the remainder of division by 10: if (day % 10 == 1) { result = “dan”; } else { result = “dana”; } % is the “Modulo” or “Modulus” Operator, unless you’re using JavaScript, in which case it is a simple remainder operator (not a true modulo). It divides the two numbers, and … Read more