Find the last Sunday of each month: Difference between revisions

Content added Content deleted
(python solution)
No edit summary
Line 229: Line 229:
Press any key to continue...
Press any key to continue...
</lang>
</lang>
=={{header|Mathematica}}==
<lang mathematica>LastSundays[year_] :=
Table[Last@
DayRange[{year, i},
DatePlus[{year, i}, {{1, "Month"}, {-1, "Day"}}], Sunday], {i,
12}]
LastSundays[2013]</lang>
Output:
<pre>{{2013, 1, 27}, {2013, 2, 24}, {2013, 3, 31}, {2013, 4, 28}, {2013, 5,
26}, {2013, 6, 30}, {2013, 7, 28}, {2013, 8, 25}, {2013, 9,
29}, {2013, 10, 27}, {2013, 11, 24}, {2013, 12, 29}}</pre>


=={{header|Perl}}==
=={{header|Perl}}==