Back To Java Flow of Control Index
//program to input a year and find whether it is a leap year or not using if-else statement public class leapyear { public static void main(String[] args) { int year; year=2001; if((year%100==0) || (year%400==0)) { System.out.println("leap year"); } else { if(year%4==0) { System.out.println("leap year"); } else { System.out.println("not a leap year"); } } } }