calculate if year is leap year

#include <iostream>
using namespace std;

int main() {
    int year;
    cout << "Enter a year: ";
    cin >> year;
    if (year % 4 == 0) {
        if (year % 100 == 0) {
            (year % 400 == 0) ?
            cout << year << " is a leap year." :
            cout << year << " is not a leap year.";
        }
        else
            cout << year << " is a leap year.";
    }
    else
        cout << year << " is not a leap year.";
    return 0;
}

3.2
5
GreyShift 85 points

                                    if (i%4==0 &amp;&amp; i%100!=0 || i%400==0) {
months[2] = 29;
}
else {
month[2] = 28;
}

3.2 (5 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
is leap year leap year test this year is leap year Write a Function to check if year number is a leap year. how to check if a given year is a leap year given a year check whether it is a leap year Program to identify whether entered year is leap year or not how many days in leap year how does leap year work ? when is it a leap year how many days in a year including leap year how to determine a leap year leap year check for leap year logic formula of leap year leap year calculation leap year how to find leapyear formula formula to calculate leap year calculate if year is leap year test leap year check if leap year or not leap year checker how to check whether the year is leap year or not how to calculate if a year is a leap year what makes a leap year a leap year how to know it is leap year are not how to know if a leap year is it a leap year how to check if it is a leap year how do you know if a year is a leap year how to find if the year is a leap year or not Write a program to check whether a year is a leap year or not. show leap years when was leap year what's a leap year logic to check a leap year finding leap year formual condition to check leap year leap year check online give the year and check if the leap year are not check if the leap year are not how to know if year is leap year calculate if leap year conditions for a year to be leap year leap year checks how to tell if year is leap year condition for a leap year how to check if the year is a leap year or nor Program to find whether a year is LEAP year or not how to count leap year check whether year is leap year or not print if a year is leap or not and the previous and next leap year leap year finding how to find leap year of not program to check leap year how to identify leap year logic to check leap year how to calculate a leap year is current year is leap year how to know a year is a leap year best to detect leap year check if year is leap year how to know leap year when is a year a leap year the leap year condition of leap year hwo to find leap year program to check a leap year 1904 is a leap year check leap year or not what defines a leap year when is there a leap year determine if it is a leap year or normal year check the given number is leap year or not find the year is leap year or not which is a leap year how to determine if a given year is a leap year or not whats a leap year how to find if a given year is a leap year what years were leap year does this year have a leap year how to find if a year is a leap year leap year or not how to calculate if leap year ow do you find the leap year how to calculate whether a year is a leap year how to know if given year is leap year how to check the year is leap year or not how to know if it is a leap year leap year is di conditions for a leap year check leapyear .com leap year checking condition checking leap year how to know if a number is leap year or not check if a year is a leap year calculate leap year or not how to check if a year is a leap year how do determine leap year or not program to check leap year or not how to check if leap year if statment leap year how to test a leap year calculate leap year how to know if a year is a leap year check if leap year leap year. how to check a leap year how to check year is leap year or not how to determine leap year when does a leap year start condition for leap year what is leap year how to check year is leap year how to check whether a year is leap year or not how to check a year is leap year how to check leap year leap year for find leap year what is a leap year is this year a leap year leap year check coming leap year When is a leap leap year leap year condition check for leap year how to find a leap year how to find leap year how to calculate leap year when is a leap year leap year Check Leap Year
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source