Computer Science, asked by shaan9935, 3 days ago

this is java program in school assignment plz tell fast​

Attachments:

Answers

Answered by purveshKolhe
5

\huge{\red{\overbrace{\underbrace{\mathfrak{\blue{answer:}}}}}}

Corrected cοde-

public class LeapYear {

  public static void main(String [] args) {

     int year = 2000;

     if (year % 4 == 0) {

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

     }

     else {

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

     }

  }

}

Errors-

  • There should be if instead of if-else.
  • There should be else instead of else-if.
  • There should be modulus sign and not slash is the condition of if statement.
  • There should be swapping of strings in println statement.

Hope it helps...

Similar questions