/**
* A program to tell whether an year is leap year or not.
* @author Umang Bhatt
*/
public class LeapYearTester
{
public static boolean isLeapYear(int year)
{
boolean isLeapYear ;
if (year % 4 == 0)
{
if (year % 100 == 0)
{
if (year % 400 == 0)
{
isLeapYear = true;
}
else
{
isLeapYear = false;
}
}
else
{
isLeapYear = true;
}
}
else
{
isLeapYear = false;
}
return isLeapYear;
}
public static void main(String args[])
{
System.out.println(isLeapYear(2003));
}
}
Sunday, October 21, 2012
leap year
Labels:
flow chart,
flowchart,
java,
leap year,
umang bhatt
Subscribe to:
Comments (Atom)
