Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Java/14.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import java.util.Scanner;
/**
*
* @author Tarannum Ara
*
*/
public class LeapYear {
static boolean checkYear(int year)
{
if (year % 400 == 0)
return true;

if (year % 100 == 0)
return false;

if (year % 4 == 0)
return true;
return false;
}

public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int year = sc.nextInt();
if(checkYear(year)) System.out.println("Leap Year");
else System.out.println("Not a Leap Year");
sc.close();
}
}