Find the last Sunday of each month: Difference between revisions

m
Line 4,538:
=={{header|S-BASIC}}==
<lang basic>
rem - computereturn p mod q
function mod(p, q = integer) = integer
end = p - q * (p/q)
Line 4,589:
d = monthdays(m, y)
w = dayofweek(m, d, y)
rem - findback nearestup prioras occurrenceneeded ofto desired weekday
if w >= k then
d = d - (w - k)
211

edits