+ 2
Program to find whether the given year is leap year or not
4 Réponses
+ 2
You have no proper braces.. ( ) for if block.
And it should be != , not just !.
edit:
public class leapyearexample
{
public static void main(String[] args) {
int year=2020;
if( ((year % 4==0)&&(year % 100 != 0))||(year % 400==0) ){
System.out.println("leap year");
}
else{
System.out.println("common year");
}
}
}
+ 2
I already added corrected code.
edited and adding here.
You have missing one more pair of brace.
if👉( condition ) 👈
edit:
if( ((year % 4==0)&&(year % 100 != 0))||(year % 400==0) ){
+ 1
Bro there are 3 more error
+ 1
Ahmed Kazia Get used to always provide full info. Instead of "there are x errors", always tell which ones.