Write a program in java to calculate a year is leap year or not

No comments
import  java.util.*;
class  leap year
{
public  static  void  main (String  obj [ ])
   {
       int  year ;
Scanner  sc=new  scanner(system.in);
System.out.println(“Enter  the  year”) ;
year=sc.nextInt();
if((year % 4= =0 && year % 100!=0)//year % 400= = 0)
system.out.println(“The  year  is  leap  year”);
else
system.out.println (“The  year  is  not  leap year”);
        }
}

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀