Home Segments Index Top Previous Next

476: Practice

Write a program that accepts two numbers, representing a year and a month, and displays the number of days in that month. Use a switch statement, and be sure to exploit the fall-through feature. Note that leap years occur in years divisible by 4, except for centenary years that are not divisible by 400.