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 the next step.

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

Mridul Sharma
2y

mathematically if the year is divisible by 4 its a leap year.

N/4 =lrap year

Help your peers!
Select
Add answer anonymously...

TCS Software Engineer interview questions & answers

A Software Engineer was asked 1d agoQ. What is DevOps?
A Software Engineer was asked 2mo agoQ. What are the SOLID design principles?
A Software Engineer was asked 2mo agoQ. What is a data type?

Popular interview questions of Software Engineer

A Software Engineer was asked 1d agoQ1. What is DevOps?
A Software Engineer was asked 1d agoQ2. What is GenAI?
A Software Engineer was asked 2mo agoQ3. What are the SOLID design principles?

Top HR questions asked in TCS Software Engineer

A Software Engineer was asked 2mo agoQ1. Can you explain the project that excited you?
A Software Engineer was asked 2mo agoQ2. Why do you want to join this job?
A Software Engineer was asked 3mo agoQ3. How does the role fit your career plans?
TCS 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