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
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
write a pseudocode or draw a flowchart for this leap year problem
Step by step
Solved in 3 steps with 1 images