Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

LOGICAL - Checking for leap year....

409788Feb 2 2004 — edited Feb 3 2004
Is the following code enough to check whether an year is a Leap year.....

Declare
v_year Number(4) := &p_year;
BEGIN
IF MOD(v_year, 4 ) = 0
Then
DBMS_OUTPUT.PUT_LINE(v_year|| ' is a leap year');
ELSE
DBMS_OUTPUT.PUT_LINE(v_year|| ' is not a leap year');
END IF;
END;
/

That is... it only checks whether it is divisible by 4.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2004
Added on Feb 2 2004
16 comments
2,248 views