(C PROGRAMMING ONLY) 1. Leap Year Detector by CodeChum Admin Let’s try to find out whether a year has 365 or 366 days. To do this, we need to create a leap year detector! Conditions for a leap year: 1.) year must be divisible by 4 and not divisible by 100 2.) If year is divisible by 100, it must be divisible by 400 for it to be a leap year. Instructions: You are provided with the isLeapYear() function which is already declared and defined for you. Your task is to ask the user for a year and then call the isLeapYear function to check whether the year is a leap year or not. Input 1. Year to be checked Output If a certain year is a leap year, print " is a leap year" Otherwise, print " is not a leap year" Enter year: 2020 2020 is a leap year
(C PROGRAMMING ONLY)
1. Leap Year Detector
by CodeChum Admin
Let’s try to find out whether a year has 365 or 366 days. To do this, we need to create a leap year detector!
Conditions for a leap year:
1.) year must be divisible by 4 and not divisible by 100
2.) If year is divisible by 100, it must be divisible by 400 for it to be a leap year.
Instructions:
You are provided with the isLeapYear() function which is already declared and defined for you.
Your task is to ask the user for a year and then call the isLeapYear function to check whether the year is a leap year or not.
Input
1. Year to be checked
Output
If a certain year is a leap year, print "<INSERT_YEAR_HERE> is a leap year"
Otherwise, print "<INSERT_YEAR_HERE> is not a leap year"
Enter year: 2020
2020 is a leap year
![Input
main.c
+ c
1. Year to be checked
1 #include<stdio.h>
int isleapYear(int);
Output
int main(void) {
// TODO: Write your code here
If a certain year is a leap year, print
<INSERT_YEAR_HERE> is a leap year"
Otherwise, print "
return 0;
<INSERT_YEAR_HERE> is not a leap
9 }
year"
10
11 - int isleapYear(int n) {
if(
(n % 4
(n % 100
) {
return 1;
}
0 && n % 100 != 0) ||
0 && n % 400
Enter year: 2020
13
2020 is a leap year
14
15 -
16
17
18
19
return 0;
1234 567090123456789
H H 1 111 111 H](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8ba97320-f38e-447e-8a6c-e66f253a2656%2F242972cc-e3e5-4c66-abb2-13881b2625ef%2Fx1ujwon_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)