int main()
{int year;
ofstream output ("e:result14.dat");
cout <<" Enter Year : "<<endl;
output<<" Enter Year : "<<endl;
cin>>year;
if(year%4==0&&year%100!=0 ||year%400==0)
cout<<" this is a leap year\n"<<endl;
output<<" this is a leap year\n"<<endl;
else
cout<<" this is not a leap year\n"<<endl;
output<<" this is not a leap year\n"<<endl;
system("PAUSE");
return 0;
}
last question.
when i go and put the year on the cin and go and to print out my output the year that i am entering is not showing .... it just shows:
enter year:
this is a leap year.
what can i do for the year to show on the out put??
A leap year is a multiple of 4 that is not also a multiple of 100, except for multiples of 400. So, for instance, 1900 was not a leap year, but 2000 was.