|
|||||
| | |||||
#include <iostream.h>
int main() {
int monthIn = 2;
int year;
cout << "please give me the year (4-digit year) =====> ";
cin >> year;
int nDays = 29;
if (year%400 == 0 || (( year%4 == 0) && !(year%100 == 0))) {
nDays = 28;
cout << "is a leapyear and nDays = 29 with parens" << endl;
}
else cout << "is not a leap year and nDays = 28" << endl;
}
| Leave a Reply |