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 do i work on code with someone else? i use visual studio code. me and a friend wanna make a game together with code. how do
Art [367]

Answer:

You can use Repl.it.com......It's best for practising coding languages...

7 0
2 years ago
A puppy weighed 6 ounces at birth. After two weeks, the puppy weighed 14 ounces. How much did the puppy gain? Model the equation
ivann1987 [24]
+8 ounces ...don't know what an alrebra tile so I just subtracted :)
7 0
2 years ago
Read 2 more answers
Male tiene una bicicleta rosa<br>es biene o es servicio?​
jekas [21]

Answer:

es biene por que es de el no es prestada asi que es biene

8 0
3 years ago
What is Digital Access, and why is it important for YOUR generation?
Harman [31]

“Our students were born with a mouse in their hands. The pervasive nature of digital culture has altered the way they think, and the way they learn. Education today is completely out of sync with this new reality.” an excerpt from Understanding the Digital Generation. The New ConnectionsThis eye-opening presentation provides a comprehensive look at how the pervasive nature of digital culture has and continues to change the brains of our students. As a result of these changes, they have developed learning styles and preferences which are in contrast to the traditional pedagogical approach. The New Connections provides a clear description of 10 core learning attributes of digital learners, and a pragmatic look at how we can teach effectively in an age when new technologies cascade onto the new digital landscape at an astonishing rate. Because of digital bombardment and the emergence of the new digital landscape, today’s youth process information, interact and communicate in fundamentally different ways than any previous generation before them. Meanwhile, many of us, having grown up in a relatively low-tech, stable, and predictable world, are constantly struggling with the speed of change, technological innovation, and the freedom to access the overwhelming sea of information online—all defining characteristics of the digital world of both today, and the swiftly-approaching future. Strategies That Work provides a comprehensive profile of several core learning attributes of digital learners, and the core teaching, learning, and assessment strategies that can be used to appeal to their digital lifestyle and learning preferences. You’ll gain a clear understanding of various research-based strategies to optimize learning for the digital generation in the new digital landscape.

7 0
2 years ago
Ravi is writing an essay on the impact of the internet on business. Help him classify the scenarios he sees around him as positi
Radda [10]

Answer: See explanation

Explanation:

Based on the options given, the positive effects of the internet on business will be:

• He recently bought a second-hand camera online, which he hadn't been able to find in any store.

• His friend sell printed T-shirts online, storing them in his basement and promoting them on social media.

The negative effects of the internet on business will be:

• A bookstore down the road shut down because people preferred the cheaper online bookstores.

• Ravi's sister complains that her boss always knows when she is late, but rarely greets her if their paths cross in office.

• One of his friend's printed T-shirts got wet and stained in the delivery truck and the buyer wrote a nasty review.

6 0
2 years ago
Other questions:
  • What is a drawback to being in Slide Show mode? a- Being able to review each slide in order
    8·2 answers
  • A _______ record is responsible for resolving an ip to a domain name.
    9·1 answer
  • True or false. Every word has only one correct spelling and pronunciation.
    6·1 answer
  • 1)Ce procent de grasimi putem găsi in lapte ?
    10·1 answer
  • What is the value of length after the code that follows is executed?int[][] nums = { new int [] {1, 2, 3},new int [] {3, 4, 5, 6
    8·1 answer
  • You are a developer for a company that is planning on using the AWS RDS service. Your Database administrator spins up a new MySQ
    7·1 answer
  • PLZ ANSWER ALL MY QUESTION. Which line of code will display the variable num rounded to the nearest tenth?
    14·1 answer
  • Working with do-while loop
    9·1 answer
  • Which of the following describes the purpose of project management? planning and organizing resources to meet a goal arranging t
    15·1 answer
  • In what type of attack does the attacker have the ciphertext of several messages that were encrypted with the same encryption al
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!