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
-Dominant- [34]
3 years ago
6

Write a program that reads an integer value from the user representing a year. The purpose of the program is to determine if the

year is a leap year (and therefore has 29 days in February) in the Gregorian calendar. A year is a leap year if it is divisible by 4, unless it is also divisible by 100 but not 400. For example, the year 2003 is not a leap year, but 2004 is. The year 1900 is not a leap year because it is divisible by 100, it is also divisible by 400. Produce an error message for any input value less than 1582 (the year the Gregorian calendar was adopted).
Computers and Technology
1 answer:
timofeeve [1]3 years ago
3 0

Answer:

Following program in c language:

#include <stdio.h> // header file

int main() // main method

{

   int year1 ; // varuiable declaration

   printf("Enter year: ");

   scanf("%d",&year1); // input year

   if(year1<1582) // checking condition if year less then 1582

   {

   printf(" invalid year please input correct year");

}

else

{

   if(year1 % 4 == 0) // checking condition of leap year  

   {

       if( year1 % 100 == 0) // checking condition of leap year  

       {

           if ( year1 % 400 != 0)  

               printf("%d is a Leap Year", year1);

           else

               printf("%d is not a Leap Year", year1);

       }

       else

           printf("%d is a Leap Year", year1 );

   }

   else

       printf("%d is not a Leap Year", year1);

}

   return 0;

}

Output:

First output

Enter year:  2004

2004 is a leap year

Second output

Enter year:  2003

2003 is not a leap year

Third output

Enter year:  200

invalid year please input correct year

Explanation:

In this program we input a year by user in "year1" variable .Initially check if year is less then 1582 then display message in console " invalid year please input correct year" otherwise control moves to else block and check the condition which is given below.

A year is leap year if it is satisfied these condition

(year1 % 4 == 0) and (year1 % 100 == 0) and  (year1 % 400 != 0)

Otherwise it is not a leap year.

You might be interested in
How to delete audio from powerpoint​
Marta_Voda [28]

Answer:

To delete an audio clip, select the audio icon on the slide and press Delete.

Hope it helps!!!!

4 0
3 years ago
Elisa and Josh need to access General Help. Elisa will press the F1 key. Josh will click on ? in the upper-right corner of the W
astraxan [27]
It will be elisa who will get to it
3 0
4 years ago
Read 2 more answers
What subnet mask can be used to segment the 172.16.0.0 network to allow for a minimum of 6 subnets while maximizing the number o
marishachu [46]

The subnet mask can be utilized to segment the 172.16.0.0 network to qualify for a minimum of 6 subnets while maximizing the numeral of broadcasters per subnet is 255.255.224.0

<h3>What do subnet masks mean?</h3>
  • A subnet mask is a 32-bit numeral formed by setting keeper bits to all 0s and developing network times to all 1s.
  • In this way, the subnet mask divides the IP speech into the network and host addresses.
  • A subnet mask is used to separate an IP address into two pieces. One element defines the host (computer), and the different part identifies the network to which it belongs.
  • To better comprehend how IP lessons and subnet masks work, look at an IP speech and see how it's managed.

To learn more about  subnet mask, refer to:

brainly.com/question/3234986

#SPJ4

5 0
2 years ago
Kali, a python programmer is using the turtle module to write the word hello, which code should she use to indicate the location
natta225 [31]

Answer:

D. # pick up the turtle and move it to (-100,200)

Explanation:

goto() option lets the user to move to a particular location.

so, goto(-100, 200) picks up the turtle and moves to the starting location will be used to indicate location to begin writing the word.

7 0
3 years ago
Read 2 more answers
Which of the following are breach prevention best practices?Access only the minimum amount of PHI/personally identifiable inform
Rudiy27

Answer:

All of this above.

Explanation:

All the mentioned practices can be use to prevent breaches.

6 0
3 years ago
Other questions:
  • Which is true for a hosted blog software
    15·2 answers
  • 8 POINTS!!!!!!!!
    6·2 answers
  • Which of the following is an example of subjunctive verb mood?
    5·1 answer
  • Which address correctly represents one that is composed of two halves, one assigned to a network adapter manufacturer, and the o
    6·1 answer
  • Answer all 1).The most common layout of keys on the keyboard is the _____ keyboard. ASDF QWERTY JKL QWOPY,
    5·2 answers
  • Within a google form when looking which option do u use?
    13·1 answer
  • __________ refers to rules, statutes, codes, and regulations established to provide a legal framework within which business may
    13·1 answer
  • Which stage of the waterfall model is most like the simple model's stage 5?
    12·1 answer
  • For BitTorrent, which of the following is true:
    6·1 answer
  • What is file management?can please help me​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!