write an algorithm to find the year is a leap year or not
Answers
Answered by
0
import java.util.Scanner;
public class Algorithm
{
public static void main()
{
Scanner in=new Scanner(System.in);
int year;
System.out.println("Enter the year");
year=in.nextInt();
if (year%4==0 && year%100==0)
{
System.out.println("It is a leap year");
}
else
{
System.out.println("It is not a leap year");
}
}
}
public class Algorithm
{
public static void main()
{
Scanner in=new Scanner(System.in);
int year;
System.out.println("Enter the year");
year=in.nextInt();
if (year%4==0 && year%100==0)
{
System.out.println("It is a leap year");
}
else
{
System.out.println("It is not a leap year");
}
}
}
Similar questions