Basics_Que_14

Home / Java Practice Question / Basics_Que_14

Basics_Que_14


Write a Java program that takes a year from the user and prints whether it is a leap year or not.

program : 


public class Loop {

public static boolean isLeap(int year){

if(year%4==0){
if(year%100==0){
if(year%400==0){
return true;
}else{
return false;
}
}else{
return true;
}
}else{
return false;
}
}

}