
Patrick B. answered 03/30/20
Math and computer tutor/teacher
using namespace std;
#include <iostream>
bool IsLeapYear( int year)
{
bool boolReturn=false;
if ( (year % 100)==0)
{
if ((year % 400)==0)
{
boolReturn=true;
}
}
else
{
if ( (year % 4)==0)
{
boolReturn=true;
}
}
return(boolReturn);
}
int main()
{
int year;
bool boolReturn;
cout << "PLEASE INPUT THE YEAR :>";
cin >> year;
boolReturn = IsLeapYear(year);
if (boolReturn)
{
cout << year << " is a leap year " << endl;
}
else
{
cout << year << " is NOT a leap year " << endl;
}
}
Luis S.
Thanks I really needed this04/22/21