Rok Przestepny

Pascal

function czyPrzestepny(rok: integer): boolean;
begin
    czyPrzestepny := ( (rok mod 4 = 0) and (rok mod 100 <> 0) ) or ( rok mod 400 = 0 );
end;

Ada

function CzyPrzestepny(rok: integer) return boolean is
begin
    if ( (rok mod 4 = 0) and (rok mod 100 /= 0) ) or ( rok mod 400 = 0 ) then
        return true;
    else
        return false;
    end if;

end CzyPrzestepny;
O ile nie zaznaczono inaczej, treść tej strony objęta jest licencją Creative Commons Attribution-ShareAlike 3.0 License