15 June, 2012

Leap Year



import java.util.*;
public class Leapyear
{
public static void main (String[] args)
{
Scanner s = new Scanner (System.in);
System.out.printf("Enter Year - :");
int year=s.nextInt();
if ((year%400==0)||((year%4==0) && (year%100!=0)))
System.out.printf("Year %d is Leap year",year);
else
System.out.printf("Year %d is not Leap year",year);
}
}

No comments:

Post a Comment

Thank You !