[fpc-pascal] Re: printing each Friday the 13 using Pascal

leledumbo leledumbo_cool at yahoo.co.id
Mon Aug 6 14:32:04 CEST 2012


Converting one of the answers there...

uses
  SysUtils;
const
  StartingYear = 2012;
var
  Year,Month: Byte;
  Date: TDateTime;
begin
  for Year in [0 .. 5] do begin
    for Month in [1 .. 12] do begin
      Date := EncodeDate(Year,Month,13);
      if DayOfWeek(Date) = 5 then begin
        WriteLn(FormatDateTime('YYYY-MM-DD',Date));
      end;
    end;
  end;
end.



--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/printing-each-Friday-the-13-using-Pascal-tp5710496p5710497.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list