Difference between revisions of "Talk:leap year/de"
From Lazarus wiki
Jump to navigationJump to search (Why not use IsLeapYear?) |
m (Fixed syntax highlighting) |
||
Line 1: | Line 1: | ||
== Use LeapYear instead? == | == Use LeapYear instead? == | ||
+ | |||
Isn't it easier to use SysUtils.LeapYear: | Isn't it easier to use SysUtils.LeapYear: | ||
− | <syntaxhighlight> | + | |
+ | <syntaxhighlight lang=pascal> | ||
program testleapyear; | program testleapyear; | ||
Latest revision as of 02:27, 19 February 2020
Use LeapYear instead?
Isn't it easier to use SysUtils.LeapYear:
program testleapyear;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes,
sysutils;
var
TestYear: integer;
begin
Testyear:=1600;
while TestYear<=2013 do
begin
if IsLeapYear(TestYear) then
writeln(Testyear,' is a leap year.**********')
else
writeln(Testyear,' is not a leap year.');
TestYear:=TestYear+39;
end;
end.