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
Can somebody tell me the Minecraft command to clear an entire world and destroy every block if u Dunno please don’t answer &gt;-
aalyn [17]

Answer:

You can't, but..

Explanation:

You cannot "clear" an already existing world.

But you can create a new one, click on "More world options", then click on "world type" until it says "superflat", and then you can click on customize and there you can remove every layer, therefore making the world to not spawn with blocks.

7 0
2 years ago
What is the fastest way to move data over long distances using the internet, for instance across countries or continents to your
Simora [160]

Answer:

Assuming you are using the AWS CLI to upload data to s3, there are two optimizations to increase the speed:

1) Parallel chunked uploading, which uploads your (large) file in chunks in parallel.

2) use Amazon S3 Transfer Acceleration

This will upload your file to a nearby CloudFront instance

You can enable this in your CLI configuration file, named config in the .aws folder. Add the following lines:

s3 =

max_concurrent_requests = 20

max_queue_size = 10000

multipart_threshold = 64MB

multipart_chunksize = 16MB

max_bandwidth = 100MB/s

use_accelerate_endpoint = true

addressing_style = path

5 0
3 years ago
If you are working in a word-processing program and need to learn more about its features, the best place to get assistance is f
attashe74 [19]
If you are working in a word-processing program and need to learn more about its features, the best place to get assistance is from the <span>application's Help menu. The help menu is usually located on the top right or left hand side corner of your window.</span>
3 0
3 years ago
Read 2 more answers
READ CAREFULLY! There is a difference between moving and copying files.a. Create a directory named . For example, mine would be
OleMash [197]

Answer:

b

Explanation:

8 0
2 years ago
Do You assign the Needs Met rating before assigning the page quality (PQ) rating?
tensa zangetsu [6.8K]
IS GOD REAL.......................?<span>

</span>
6 0
3 years ago
Other questions:
  • Which BI tool or technique would be most useful in predicting the likelihood of a fire in a building? a. Data mining b. Dashboar
    9·1 answer
  • Web pages with personal or biograpic information are called ​
    10·1 answer
  • What is PHP language
    12·1 answer
  • Which tabs are expandable and collapsible? Check all that apply.
    7·2 answers
  • How has science fiction influenced technology
    7·2 answers
  • Kyle asked his supervisor which type of computing model was used when the enterprise first started. She explained that the organ
    14·1 answer
  • What is a set of best practices that helps an organization to maximize the benefits of an information system, while at the same
    5·1 answer
  • Numerical methods are implementations of mathematical algorithms, but constructed with special consideration for accuracy of sol
    7·1 answer
  • The phrase ________ refers to data that is inaccurate, incomplete, or erroneous.
    6·2 answers
  • The Linux tail command prints the last maximum n lines of a file. When writing a function that performs this function, choose th
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!