
Concept explainers
Days in Current Month
Write a
Use the following criteria to identify leap years:
1. A year Y is divisible by 100. Then Y is a leap year if and only if it is divisible by 400. For example, 2000 is a leap year but 2100 is not.
2. A year Y is not divisible by 100. Then Y is a leap year if and only if it is divisible by 4. For example, 2008 is a leap year but 2009 is not.
Here is sample run of the program:
Enter month and year: 2 2008[Enter]
29 days
Enter month and year: 0 0[Enter]
The current month, September 2009, has 30 days.

Want to see the full answer?
Check out a sample textbook solution
Chapter 10 Solutions
Starting Out with C++: Early Objects (9th Edition)
Additional Engineering Textbook Solutions
Fluid Mechanics: Fundamentals and Applications
Web Development and Design Foundations with HTML5 (8th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
SURVEY OF OPERATING SYSTEMS
Management Information Systems: Managing The Digital Firm (16th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)