Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class leapyear
- {
- public static void main(String[] args)
- {
- System.out.println("Enter year to find out if its a leap year");
- Scanner scan = new Scanner(System.in);
- int n= scan.nextInt();
- if (n%4==0){
- System.out.println("The given year is a leap year");
- }
- else{
- System.out.println("This is not a leap year");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment