Problem 1: Get two years, A and B, from the user and print all possible leap years in the range [A, B] inclusive. Note: Leap year has 366 days instead of 365 days. Every 4 years we have a leap year. A leap year is a non-century year which is evenly divisible by 4. A century year is the year which ends with 00 (e.g., 1900, 2000, etc. ). Century year also can be a leap year if it is evenly divisible by 400. Sample Input 2000 2020 1880 1920 1999 2003 1899 1903 Sample Output 2000, 2004, 2008, 2012, 2016, 2020 1880, 1884, 1888, 1892, 1896, 1904, 1908, 1912, 1916, 1920 2000

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

write a pseudocode or draw a flowchart for this leap year problem

Write a pseudocode or draw a flowchart for the following problem
Problem 1: Get two years, A and B, from the user and print all possible leap years in the range [A,
B] inclusive.
Note: Leap year has 366 days instead of 365 days. Every 4 years we have a leap year. A leap year
is a non-century year which is evenly divisible by 4. A century year is the year which ends with 00
(e.g., 1900, 2000, etc. ). Century year also can be a leap year if it is evenly divisible by 400.
Sample Input
2000 2020
1880 1920
1999 2003
1899 1903
Sample Output
2000, 2004, 2008, 2012, 2016, 2020
1880, 1884, 1888, 1892, 1896, 1904, 1908,
1912, 1916, 1920
2000
Transcribed Image Text:Write a pseudocode or draw a flowchart for the following problem Problem 1: Get two years, A and B, from the user and print all possible leap years in the range [A, B] inclusive. Note: Leap year has 366 days instead of 365 days. Every 4 years we have a leap year. A leap year is a non-century year which is evenly divisible by 4. A century year is the year which ends with 00 (e.g., 1900, 2000, etc. ). Century year also can be a leap year if it is evenly divisible by 400. Sample Input 2000 2020 1880 1920 1999 2003 1899 1903 Sample Output 2000, 2004, 2008, 2012, 2016, 2020 1880, 1884, 1888, 1892, 1896, 1904, 1908, 1912, 1916, 1920 2000
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education