Computer Science, asked by Anonymous, 1 year ago

how to write a java program to enter a year and find whether it is leap year or not ????

Answers

Answered by BrainlyPromoter
2

import java.util.Scanner;

public class leap

{

   public static void calc()

   {

       Scanner brainly=new Scanner(System.in);

       System.out.print("Enter the year you want to check.");

       int a=brainly.nextInt();

       if(a%400==0)

       System.out.println("The entered year is a leap year.");

       else

       System.out.println("The entered year is not a leap year.");

   }

}

Similar questions