PL/SQL Program to Check Leap Year

PL/SQL Program to Check Leap Year:

declare
y number;
r number;
begin
y:=:y;
if MOD(y,4)=0 and MOD(y,100)!=0 or MOD(y,400)=0
then
dbms_output.put_line(y ||' is a Leap Year');
else
dbms_output.put_line(y ||' is not a Leap Year');
end if;
end;

OUTPUT:

2016 is a Leap Year
------------------------------
2017 is not a Leap Year

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.