
AnswerBot
2y
Coding to check if a given year is leap or not
A year is a leap year if it is divisible by 4 but not by 100, or if it is divisible by 400
Use modulo operator to check if the year is divisible by 4, 100,...read more

PrepInsta
author
3y
#include int main() { int year; year = 2016; if (((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0)) printf("%d is a leap year", year); else printf("%d is not a leap year", year); return 0; }
Help your peers!
Add answer anonymously...
Cognizant GenC interview questions & answers
A GenC was asked 2mo agoQ. Write a function that reverses a string. The input string is given as an array o...read more
A GenC was asked 2mo agoQ. How do you find the greatest number from an array?
A GenC was asked 7mo agoQ. Write code to determine if a number is an Armstrong number.
Popular interview questions of GenC
A GenC was asked 2mo agoQ1. Write a function that reverses a string. The input string is given as an array o...read more
A GenC was asked 2mo agoQ2. How do you find the greatest number from an array?
A GenC was asked 7mo agoQ3. Write code to determine if a number is an Armstrong number.
Top HR questions asked in Cognizant GenC
A GenC was asked 5mo agoQ1. Can you tell me about yourself?
A GenC was asked 6mo agoQ2. Can you explain your project in detail?
A GenC was asked 7mo agoQ3. Tell me about your projects.
Stay ahead in your career. Get AmbitionBox app


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
AmbitionBox Awards
Get AmbitionBox app

