LEAP YEAR OR NOT
import java.util.*;
class leapyear
{
public static void main()
{
int year;
Scanner sc=new Scanner(System.in);
System.out.print("Input the year : ");
year=sc.nextInt();
if (year%4==0)
{
System.out.print("The year is a leap year : "+year);
}
else
{
System.out.print("the year is not a leap year : "+year);
}
}
}
OUTPUT
0 Comments