Hi ALL,
Here I wrote a program for Finding Leap Year in java.
/**
*
* @author Balamurgan
M
*/
import java.util.Scanner;
public class LeapYear {
public static void main(String arg[]){
System.out.println("Plase enter the year");
Scanner in=new
Scanner(System.in);
int
year=in.nextInt();
if((((year%4)==0)&&(year%100)!=0)||(year%400)==0)
System.out.println("It is leap year "+year);
else
System.out.println(" It is not a Leap Year "+year);
}
}
No comments:
Post a Comment