Answers for "program to find leap year or not"

2

find leap year

function leapYear(year)
{
  return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
Posted by: Guest on April-20-2022
0

Leap year program

#include <stdio.h>

int main() {
   int year;
   year = 2016;

   if (((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0))
      printf("%d is a leap year", year);
   else
      printf("%d is not a leap year", year);

   return 0;
}
Posted by: Guest on October-20-2021
0

Check if a year is leap year

#include<iostream>
using namespace std;
int main() {
   int year = 2016;
   if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
   cout<<year<<" is a leap year";
   else
   cout<<year<<" is not a leap year";
   return 0;
}
Posted by: Guest on August-21-2021

Code answers related to "program to find leap year or not"

Code answers related to "Javascript"

Browse Popular Code Answers by Language