leonteale

leap year

Feb 17th, 2012
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. import java.util.Scanner;
  2. class  leapyear
  3. {
  4.   public static void main(String[] args)
  5.   {
  6.   System.out.println("Enter year to find out if its a leap year");
  7.   Scanner scan = new Scanner(System.in);
  8.   int n= scan.nextInt();
  9.   if (n%4==0){
  10.   System.out.println("The given year is a leap year");
  11.   }
  12.   else{
  13.   System.out.println("This is not a leap year");
  14.   }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment