I have 1 error in both of these. It's an extra credit assignment. This is my first time coding with Java and I don't know what to fix because when I compile it, it says one error and it wont run.
The First One:
The second one
public static void main(String args[]){ boolean leapYear = false; for(int year = 1900; year <= 2013; year++){ if(year % 400 == 0){ leapYear = true; }else if(year % 100 == 0){ leapYear = false; }else if(year % 4 == 0){ leapYear = true; }else{ leapYear = false; } if(leapYear == true){ System.out.println(year + " is a leap year"); } } }
If someone could help me out with these that would be great. Pretty urgent need to send it in tonight.