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
The property that allows a metal to be drawn into wires is called...
GaryK [48]

Answer:

Malleability and ductility

Explanation:

Metals are also easily distinguished from non-metals and other materials in their ductility (ability to be drawn into a wire) and malleability (the ability to be beaten into a. sheet).

Did you need help on this with an assignment? Hope this helps!

6 0
3 years ago
The general who directed the project responsible for the "Fat Man” graduated from what alma mater in 1918? Hint: W___ P____.
artcher [175]
<span>The general who directed the project responsible for the "Fat Man” graduated from : West point The fat man project refer to the codename of the atomic bomb that were dropped on top of Nagasaki in 1945. Although by dropping the bomb we did made japan surrender from the world war II, we killed more than 50,000 people with a single bombHope this helps. Let me know if you need additional help!</span>
5 0
3 years ago
17. Which of the following is not a visible section in a File Explorer window?
andrew-mc [135]

Answer: D.)

Explanation: Clipboard

4 0
3 years ago
50 POINTS PLEASE HELP MEEEEEEEEE!!!!!!
Zolol [24]

The answer is A for 1. And C for 2.

Hope this helps.

3 0
4 years ago
Read 2 more answers
How would you describe the relationship between blocks of code and commands?<br>HELP​
Karolina [17]

Answer:

Code and Commands have similar programs coding has only one thing to do or done but commands can be told anytime by an input device.

Explanation:

hope this helps.

7 0
3 years ago
Other questions:
  • 1. What is the global marketplace?
    11·2 answers
  • You are boating on a lake. the weather turns bad. what should all passengers do first?
    14·2 answers
  • What does TSOn stand for?
    8·2 answers
  • Describe the four techniques mentioned in the article that help you, the speaker, keep your audience engaged
    9·1 answer
  • Platon says, when taking a photo you should:<br> (Photography class)
    5·1 answer
  • List and briefly defined categories of security services.
    8·1 answer
  • What is the absolute pathname of the YUM configuration file? REMEMBER: An absolute pathname begins with a forward slash
    12·1 answer
  • You want to discard your old computer and want to securely erase the data from your hard drive. What can you use to do this and
    10·1 answer
  • A form of encryption that uses only one key to encrypt and decrypt a file. This is a less
    14·1 answer
  • What is the size of BIOS?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!