- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Check if a given year is leap year in PL/SQL
Here we will see how to check given year is leap year or not, using PL/SQL. In PL/SQL code, some group of commands are arranged within a block of related declaration of statements.
The leap year checking algorithm is like below.
Algorithm
isLeapYear(year): begin if year is divisible by 4 and not divisible by 100, then it is leap year else if the number is divisible by 400, then it is leap year else it is not leap year end
Example
DECLARE year NUMBER := 2012; BEGIN IF MOD(year, 4)=0 AND MOD(year, 100)!=0 OR MOD(year, 400)=0 THEN dbms_output.Put_line(year || ' is leap year '); ELSE dbms_output.Put_line(year || ' is not leap year.'); END IF; END;
Output
2012 is leap year
- Related Articles
- JavaScript program to check if a given year is leap year
- Program to check if a given year is leap year in C
- Golang Program to Check Whether a Given Year is a Leap Year
- PHP program to check if a year is leap year or not
- How to detect if a given year is a Leap year in Oracle?
- C++ Program to Check Leap Year
- Java Program to Check Leap Year
- Python Pandas - Check whether the year is a leap year from the Period object
- Java program to find if the given number is a leap year?
- How to Check Leap Year using Python?
- How to check whether a year or a vector of years is leap year or not in R?
- How to find leap year or not in android using year API class?
- What do you mean by a leap year?
- Checking for a Leap Year using GregorianCalendar in Java
- What is the probability of getting $53$ Mondays in a leap year?

Advertisements