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
Who was the first person to make a portable computer?
Bad White [126]
It was invented by Osborne<span> Computers</span>
8 0
3 years ago
The ____ command enables you to initialize the terminal display or terminal window, to place text and prompts in desired locatio
inn [45]

Answer:

tput

Explanation:

8 0
4 years ago
I have $80 and I want a smartphone that you can call for free what should I get
SVEN [57.7K]
Downloading an apps than provides u a free chat and video call .
6 0
3 years ago
Read 2 more answers
Which option lists the correct steps to apply a style?
pav-90 [236]

Explanation:

b is answer l think is the ans

8 0
4 years ago
Question 5 of 5
Archy [21]

<u>Answer:</u>

<em>Sewage treatment Programs </em>

<u>Explanation:</u>

Sewage treatment programs are the right choice <em>because these are the source to create germs and if we understand how to be clean, most of the disease is avoided. </em>

<em>Drug regulation:</em> It is nothing but the continuous treatment of prolonged disease where pills needs to be taken regularly to protect patients from death or to avoid disease become more severe.

<em>Physical fitness campaign:</em> This concentrate on to how to keep bod fit through exercise and it does not deal with hygiene.

<em>Nutrition Education:</em> It’s a kind of protection mechanism where in-take of food is really concentrated to fight against germs.

5 0
4 years ago
Other questions:
  • Which resource do programmers sometimes have to refer to and use during planning the logical steps of the solution?
    10·2 answers
  • Write a Python 3 program that will compute the total cost of an amazon purchase. The program should ask the user to enter the am
    10·1 answer
  • Understanding the context of information allows you to apply it to everyday situations as opposed to just___facts like names,dat
    12·1 answer
  • The person who suggested that the continents were once a supercontinent, called Pangaea, but slowly drifted apart was who
    10·2 answers
  • John wants to share resources and move a large volume of data quickly over the Internet. John should use which of the following
    9·1 answer
  • What is the web of trust
    7·2 answers
  • FREEE POINTS
    8·2 answers
  • Help it’s an exam brainleist
    8·1 answer
  • How many total bits are required for a direct-mapped cache with 128 blocks and a block size of 8 bytes, assuming a 4GB main memo
    15·1 answer
  • In a typical day, what types of Computer-Mediated Communication do you use?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!