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.
Be the first one to answer
Add answer anonymously...
Cuemath Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

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

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter