├── README.md ├── Leapyr.java └── .gitignore /README.md: -------------------------------------------------------------------------------- 1 | # Leap-Year-or-not-Java 2 | We will write Leap Year Program in Java. Given an integer input “year” the objective is to check if the given year is a leap year or not using the conditions for a leap year. Therefore, keeping them in mind we write a code to Check Whether or Not the Year is a Leap Year in Java Language. 3 | -------------------------------------------------------------------------------- /Leapyr.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | public class Leapyr 3 | { 4 | public static void main(String[] args) { 5 | Scanner sc=new Scanner(System.in); 6 | int year=sc.nextInt(); 7 | if(year%4==0 && year%100!=0||year%400==0){ 8 | System.out.println("Leap Year"); 9 | } 10 | else{ 11 | System.out.println("Not Leap Year"); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | replay_pid* 25 | --------------------------------------------------------------------------------