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
Melissa is the network administrator for a small publishing company. as network administrator, she is in charge of maintaining t
Arte-miy333 [17]
The answer is an Intruder Prevention System (IPS). An Intrusion Detection System (IDS) will detect an attack but will not block it.
3 0
3 years ago
Which button is used to open the Start menu in Windows Vista?
Karo-lina-s [1.5K]
The answer is B. Windows icon
4 0
3 years ago
Who is the CEO of Epic Games?​
slavikrds [6]

Answer:

it's tim sweeney....

Explanation:

hope it helps

4 0
3 years ago
Read 2 more answers
Which type of computer application is apple keynote? a. word processor b. spreadsheet c. presentation d. database e. multimedia
Naily [24]

The type of computer application which apple keynote is, is: c. presentation.

<h3>What is a presentation application?</h3>

A presentation application can be defined as a type of computer application which is designed and developed to avail its end users an ability to create various slides that comprises both textual and multimedia information, which are typically used during a presentation.

This ultimately implies that, apple keynote is an example of a presentation application which is used on computers.

Read more on presentation application here: brainly.com/question/26404012

#SPJ4

4 0
2 years ago
You can set the margin using the rular also true or false​
Murljashka [212]

Answer:

true

Explanation:

7 0
2 years ago
Other questions:
  • Information management examines the organizational resource of information and regulates its definitions, uses, value, and distr
    11·1 answer
  • Is this photo considered rim photography
    11·1 answer
  • Word 2013 opens, by default, on a blank document?
    13·2 answers
  • Interpretations of the AICPA Code of Professional Conduct are dominated by the concept of: Question 4 options: 1) independence.
    5·1 answer
  • . Two or more functions may have the same name, as long as their _________ are different.
    9·1 answer
  • What is output by the following program? int i = 7; while (i&gt;=2){System.out.print (i +""); if ((i%3) == 0){ i +2; } else { i/
    6·1 answer
  • Are one of the greatest features of Photoshop that allow nondestructive editing of images.
    6·1 answer
  • What is malware? a type of virus that spreads through a network connection a type of virus that targets programs and files any p
    12·1 answer
  • The getElementById DOM Method do?
    13·1 answer
  • takes the perspective that a program describes what the solution to a problem is, not how that problem is solved. Select one: a.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!