diff --git a/leapyear.war b/leapyear.war new file mode 100644 index 0000000..dcc4d07 --- /dev/null +++ b/leapyear.war @@ -0,0 +1,21 @@ +public class Main { + + public static void main(String[] args) { + + // year to be checked + int year = 1900; + boolean leap = false; + + // if the year is divided by 4 + if (year % 4 == 0) { + + // if the year is century + if (year % 100 == 0) { + + // if year is divided by 400 + // then it is a leap year + if (year % 400 == 0) + leap = true; + else + leap = false; + } diff --git a/test_file b/test_file deleted file mode 100644 index f73f309..0000000 --- a/test_file +++ /dev/null @@ -1 +0,0 @@ -file