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
Kyle, a receptionist for a building supply company, recently won an award for saving his company money on their phone system. Af
Akimi4 [234]
The answer is most likely VoIP which means Voice over Internet Protocol. This is for example skype
8 0
3 years ago
Read 2 more answers
Which of the following is required when operating a cutting or grinding machine?
Natali [406]

Answer:

?

Explanation:

we need the options.

7 0
3 years ago
Read 2 more answers
To recover a deleted document, what would you choose in the Info window?
kiruha [24]
Retrive you can restart your computer press f8 it will takr you to a menu were you can choos recover lost files then go from there
6 0
4 years ago
Hurry i need help swear to god i will give brainliest not lying
madam [21]

Answer:

finding area of a circle

def area(radius):

   int(radius)

   formula = radius * radius * 3.14

   print(formula)

radius_input = int(input('Insert the radius of your circle: '))

area(radius_input)

hope this helped :D

6 0
3 years ago
The three activities in an information system that produce the information organizations use to control operations are: 1. infor
forsale [732]

Answer:

5. Input, Processing, and Output

Explanation:

Input, processing, and output are the three activities in an information system that produce the information an organisation needs.

<em>Input</em> captures or collects raw data from within the organisation or from its external environment.

<em>Processing</em> converts this raw input into a meaningful form.

<em>Output</em> transfers the processed information to the people who will use it or to the activities for which it will be used. Information systems also require feedback, which is output that is returned to appropriate members of the organisation to help them evaluate or correct the input stage.

7 0
3 years ago
Other questions:
  • Which statement below is inaccurate? a. Web 2.0 is a simple static website without any interaction with its users b. Web 2.0 bri
    5·1 answer
  • Jason needs to renew the certificate for his company’s web server. Which of the following is recommended to be submitted to the
    6·1 answer
  • Provided you have an Internet connection and functional Web browser, gather information on three different commercial RAID contr
    13·1 answer
  • Guys for those who are familiar to bubble gum sim...THERE IS A HUGE EVENT AND I DONT WANT TO FAIL AN EVENT...(again) is anyone w
    9·1 answer
  • When you expand the virtual size of a game, what do you create?
    7·1 answer
  • I am needing help with this homework of mine.
    7·1 answer
  • Why might you use a navigation form instead of tab pages? The navigation form allows for several levels and sublevels to be coll
    7·2 answers
  • Question 1 of 10 Chase lives in Oregon but works for a company that is located in Florida. What business trend is this an exampl
    11·2 answers
  • The image below is an example of a
    6·1 answer
  • What interior feature is now standard on platinum models for 2022 maxima?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!