Saturday, 19 February 2011

Check leap year in java


Java code to check whether a given year in leap year or not



import java.io.*;




class Test {

     public static void main(String[] args) throws IOException {

          int year;

          System.out.println("Enter the year");

          BufferedReader br=new BufferedReader(new InputStreamReader (System.in));

          year=Integer.parseInt(br.readLine());

          if(((year%4==0)&&(

No comments:

Post a Comment