1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pachacha [2.7K]
3 years ago
5

#A year is considered a leap year if it abides by the #following rules: # # - Every 4th year IS a leap year, EXCEPT... # - Every

100th year is NOT a leap year, EXCEPT... # - Every 400th year IS a leap year. # #This starts at year 0. For example: # # - 1993 is not a leap year because it is not a multiple of 4. # - 1996 is a leap year because it is a multiple of 4. # - 1900 is not a leap year because it is a multiple of 100, # even though it is a multiple of 4. # - 2000 is a leap year because it is a multiple of 400, # even though it is a multiple of 100. # #Write a function called is_leap_year. is_leap_year should #take one parameter: year, an integer. It should return the #boolean True if that year is a leap year, the boolean False #if it is not. #Write your function here!

Computers and Technology
1 answer:
lara [203]3 years ago
5 0

Answer:

To check if the year comes under each 100th year, lets check if the remainder when dividing with 100 is 0 or not.

Similarly check for 400th year and multiple 0f 4. The following C program describes the function.

#include<stdio.h>

#include<stdbool.h>

bool is_leap_year(int year);

void main()

{

int y;

bool b;

 

printf("Enter the year in yyyy format: e.g. 1999 \n");

scanf("%d", &y);     // taking the input year in yyyy format.

 

b= is_leap_year(y);  //calling the function and returning the output to b

if(b==true)

{

 printf("Thae given year is a leap year \n");

}

else

{

 printf("The given year is not a leap year \n");

}

}

bool is_leap_year(int year)

{

if(year%100==0)   //every 100th year

{

 if(year%400==0)   //every 400th year

 {

  return true;

 }

 else

 {

  return false;

 }

}

if(year%4==0)  //is a multiple of 4

{

 return true;

}

else

{

 return false;

}

}

Explanation:

Output is given as image

You might be interested in
How to change the microsoft word pages to black background
slamgirl [31]

Answer:

To turn on Dark mode in the Word canvas, select File > Account > Office Theme > Black. 2. Once the black theme is set, you can toggle between the black and white page background colors by selecting View > Switch Modes from the ribbon.

6 0
3 years ago
How does this splitting wedge make work easier?
Pavlova-9 [17]
The believe that the best answer among the choices provided by the question is D) changes the direction and amount of applied force

Hope my answer would be a great help for you.    If you have more questions feel free to ask here at Brainly.
3 0
3 years ago
is there an app i can use to make a picture appear in the corner of a video then disappear after being up for a second?
Nuetrik [128]
Umm i really do not know i'm sorry
7 0
4 years ago
Read 2 more answers
The term drive app is used to describe applications stored on a computer true or false
Volgvan
Hello <span>Areyano7475
</span>

Question: T<span>he term drive app is used to describe applications stored on a computer true or false


Answer: False


Hope this helps
-Chris</span>
7 0
3 years ago
Read 2 more answers
F he continues to make monthly payments of $100, and makes no new purchases, how many more payments will he have to make before
castortr0y [4]

What is the interest rate?

Divide the total amount due by 100.

8 0
3 years ago
Other questions:
  • Exit network systems, information support, and software development are all careers in which career cluster?
    10·1 answer
  • On most desktop computers, most of the USB ports are on the back of the computer case. Generally, you'll want to connect your mo
    13·1 answer
  • Illusions in physcology​
    14·1 answer
  • What percent of the internet is the deep web?
    14·1 answer
  • Whic flag has a special role in debuging
    6·1 answer
  • Which one of the following items is an example of software?
    5·1 answer
  • What would be an ideal scenario for using edge computing solutions?
    10·1 answer
  • Help me please. I'LL MARK BRAINIEST
    15·1 answer
  • What is a key differentiator of Conversational Artificial Intelligence (AI)
    11·1 answer
  • Which option will be used to attach email messages ​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!