aykuta3474 / depoo

0 stars 0 forks source link

ArtıkYılHesaplama #15

Open aykuta3474 opened 2 years ago

aykuta3474 commented 2 years ago

import java.util.Scanner;

public class ArtıkYılHesaplama { public static void main(String[] args) {

    int year;

    Scanner input = new Scanner(System.in);

    System.out.print("Enter a year: ");
    year = input.nextInt();

    if ((year % 4) == 0) {
        if ((year % 100) == 0) {
            if ((year % 400) == 0) {
                System.out.println(year + " is a leap year!");
            } else {
                System.out.println(year + " is not a leap year!");
            }
        } else {
            System.out.println(year + " is a leap year!");
        }
    } else {
        System.out.println(year + " is not a leap year!");
    }
}

}