The Open Source Swiss Army Knife

/code/cPP/basics_cPP/
/code/cPP/basics_cPP/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /code   /cPP   /basics_cPP 
Permalink: or.c
Title: x = 0xF2 | 0xEC 11111110 ---
article options : please login   |  raw source view  

#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
Your Name:     anonymous
Your Email:
Website:  
Comments:

The author will be notified of your reply.
return to top