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

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 27PE
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr