View Code of Problem 28

import java.util.Scanner;
 
 
 
public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while(scanner.hasNext()) {
			int year = scanner.nextInt();
			if((year % 4 == 0 && year % 100 != 0) || 
					year % 400 == 0) {
				System.out.println("Leap Year");
			}else {
				System.out.println("Not Leap Year");
			}
		}
	
		scanner.close();	
	}
 
 
}

Double click to view unformatted code.


Back to problem 28