find leap year
function leapYear(year)
{
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
find leap year
function leapYear(year)
{
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
Check if a year is a leap year
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
cout<<year<<" is a leap year";
else
cout<<year<<" is not a leap year";
how can you know if a year is a leap year
leapYear = int(input("Input a Year "))
if leapYear %4 == 0:
print("Its a leap year")
else:
print ("Its a normal year")
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;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us