How to check to leep year?

How to check to leep year?
void main() {
  // write a variable for twar
  int year = 2024; // you can change this to any year you want to check
  //using ternary operator to check for leap year
  String results = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
      ? "$year,is a leap year "
      : "$year,not a leap year";
  //print this result
  print(results);
  //results show terminal
  //thanks you
  //please subscribe my channel and like this video thanks
}

Youtube tutarial

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *