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
(a)Ms word is a isa word processing software ,(b)hub provides physical connection between all computers, State true or false​
8090 [49]

Answer:

true

Explanation:

true in answer in the question

8 0
2 years ago
Read 2 more answers
Create a class named CollegeCourse that includes the following data fields: dept (String) - holds the department (for example, E
frez [133]

Answer:

The answer to this question can be given as:

code:

class CollegeCourse  

{

String Dept;

int CourseNumber;

double Credits;

double fee;

}

Explanation:

We all know that class is a collection of data members and member functions. In the above code we use the following syntax for class declaration that can be given as:

Syntax of class declaration :

class class_name

{

data member & member function

}

In the above code firstly we declare a class that is CollegeCourse. In this class, we define a variable that name and datatype is already given in the question that is String Dept, int CourseNumber, double Credits, double fee. In the variables first variable data type is string. It is used for store string value like ('us','xxx','aaa').The second variable datatype is an integer. It is used for store integer value like (1,23,5,56). The third and fourth variable datatype is the same that is double. This data type is used to store the floating-point value.

5 0
3 years ago
What is an allocation unit?
sdas [7]
It is a unit of disk space allocation for files and directories. Hope this helps :) 
5 0
3 years ago
What do TCP/IP MEAN​
melomori [17]

Answer:IP is internet protocol, every router has one some routers are dynamic which means they change everything the router reboots and some routers are static which means you would have to call your isp(Internet Service Provider) to get it changed.

Explanation: I do illegal things :)

8 0
3 years ago
My cell phone rear camera is dirty does anyone know how to clean it?
Vesna [10]
If you have glasses the liquid and cloth can be used to clean it. You spray the camera, then use the cloth to wipe it up. If you don't have them the dollar store should have some, or even places like Walmart and Maceys.
5 0
2 years ago
Read 2 more answers
Other questions:
  • Convert 578.2 into hexadecimal​
    13·1 answer
  • On a spreadsheet, this is the term for a grouping of cells that touch each other and form a rectangle. An example of it would be
    13·1 answer
  • Object-oriented programs employ a group of techniques for handling errors called ________ handling.
    12·1 answer
  • Looking for friends, anyone up for it?
    12·2 answers
  • As marketing manager, you need to have ( blank) skills and (blank) skills.
    11·1 answer
  • Which of the following would most likely be the target audience for a product
    7·2 answers
  • What is the value of the variable named result after the following code executes?
    10·1 answer
  • 100 POINTS. DO NOT SPAM. OR I WILL REPORT.
    13·2 answers
  • What are the tools in creating an animation?
    7·1 answer
  • Class Main {
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!