- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathif_else__leap_year.java
More file actions
Latest commit
19 lines (16 loc) · 719 Bytes
/
Copy pathif_else__leap_year.java
File metadata and controls
19 lines (16 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Question Check Insert Year Is Leap Year Or not
// Take the Input from User
// Check Input integer is Leap Year Or Not
importjava.util.Scanner;
publicclassif_else__leap_year{ //Class Name
publicstaticvoidmain(Stringargs[]){
// int year;
Scannerobj=newScanner(System.in);//Scanner class for taking input
System.out.println("\n Enter The year to check its leap year or not");
intyear=obj.nextInt(); // taking input
if((year%400==0)||(year%4==0)) //apply OR condition to check
System.out.println(year+" its is a leap Year");
else
System.out.println(year+" its not a leap year");
}
}