Assignment no 0-WPS Office
Assignment no 0-WPS Office
Cs201
#include <iostream>
#include <string>
int main() {
// Drop the last two digits and take the next four digits
if (isLeapYear) {
cout << year << " is not a leap year." << endl;
int month;
int days;
switch (month) {
case 1: // January
case 3: // March
case 5: // May
case 7: // July
case 8: // August
days = 31;
break;
case 4: // April
case 6: // June
case 9: // September
days = 30;
break;
case 2: // February
if (isLeapYear) {
days = 29;
} else {
days = 28;
break;
default:
cout << "Invalid month! Please enter a number between 1 and 12." << endl;
cout << "Number of days in month " << month << ": " << days << endl;
return 0;