Last Friday of each month: Difference between revisions

m
Line 2,905:
=={{header|Pascal}}==
{{works with|Free Pascal}}
Using Free Pascal'sthe DateUtils library included with Free Pascal would simplify the coding (see the Delphi example) but for older Pascal implementations the needed routines are the programmer's responsibility!
<lang Pascal>
program LastFriday;
Line 2,963:
end;
 
{ return the calendar day of the last specifiedoccurrence weekdayof the }
{ specified weekday in athe given month and year }
function LastWeekday(k : weekdays; m, y : integer) : integer;
var
Line 2,990:
begin
d := LastWeekday(Fri, m, y);
writeln(m:5,' ',d:5, ' ');
end;
end.
211

edits