Leap Year Checker

Determine if a given year, represented as an integer 'N', is a leap year.

A leap year is defined as a year with 366 days, unlike a normal year which has 365 days.

Input:

The initial input line contains an integer T, indicating the count of test cases.
Each test case follows with an integer 'N', representing the year to evaluate.

Output:

Output "Yes" for each test case if 'N' is a leap year, otherwise output "No".

Example:

Input:
3
2000
1900
2024
Output:
Yes
No
Yes

Constraints:

  • 1 <= T <= 100
  • 1000 <= N <= 9999
  • Time limit: 1 sec

Note:

You are not required to print anything; the function already handles output. Implement the function to provide the answer.
AnswerBot
4mo

The task is to determine if a given year is a leap year or not.

  • Check if the year is divisible by 4, if yes then proceed to next step

  • If the year is divisible by 100, then it should also be divisible by...read more

Help your peers!
Select
Add answer anonymously...
Cuemath Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits