Last Friday of each month: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Minor tidy) |
(BBC BASIC entry.) |
||
Line 861: | Line 861: | ||
2012-12-28 |
2012-12-28 |
||
</pre> |
</pre> |
||
=={{header|BBC BASIC}}== |
|||
{{works with|BBC BASIC for Windows}} |
|||
<syntaxhighlight lang="bbcbasic"> INSTALL @lib$ + "DATELIB" |
|||
INPUT "What year to calculate (YYYY)? " Year% |
|||
PRINT '"Last Fridays in ";Year% " are on:" |
|||
FOR Month%=1 TO 12 |
|||
PRINT Year% "-" RIGHT$("0" + STR$Month%, 2) "-"; \ |
|||
\ FN_dim(Month%, Year%) - (FN_dow(FN_mjd(FN_dim(Month%, Year%), Month%, Year%)) + 2) MOD 7 |
|||
NEXT</syntaxhighlight> |
|||
{{out}} |
|||
<pre>What year to calculate (YYYY)? 2023 |
|||
Last Fridays in 2023 are on: |
|||
2023-01-27 |
|||
2023-02-24 |
|||
2023-03-31 |
|||
2023-04-28 |
|||
2023-05-26 |
|||
2023-06-30 |
|||
2023-07-28 |
|||
2023-08-25 |
|||
2023-09-29 |
|||
2023-10-27 |
|||
2023-11-24 |
|||
2023-12-29</pre> |
|||
=={{header|Befunge}}== |
=={{header|Befunge}}== |