Find the last Sunday of each month: Difference between revisions

Content added Content deleted
Line 4,405: Line 4,405:


$constant SUNDAY = 0
$constant SUNDAY = 0
var m = integer
var m, y = integer
input "Display last Sundays in what year"; y
print "Last Sunday of each month in 2021"
for m = 1 to 12
for m = 1 to 12
print shortmonth(m);" ";lastkday(SUNDAY, m, 2021)
print shortmonth(m);" ";lastkday(SUNDAY, m, y)
next m
next m

end</lang>
end</lang>
{{out}}
{{out}}
<pre>
<pre>
Last sunday of each month in 2021
Display last Sundays in what year? 2021
Jan 21
Jan 21
Feb 28
Feb 28