if ((( Year % 4 == 0) && (! ( Year % 100 == 0))) || (( Year % 4 == 0) && (! ( Year % 100 == 0))&&( Year % 400 == 0)))
{
cout<<"The Year "<<Year<<" is a leap year!!"<<endl;
else
cout<<Year<<" is not a leap year."<<endl;
}
with this code, I seem to be getting these error message with my "else"
In function `int main()':
expected primary-expression before "else"
expected `;' before "else"
I have tried another set of brackets around the else but that doesn't do anything either.
if ((( Year % 4 == 0) && (! ( Year % 100 == 0))) || (( Year % 4 == 0) && (! ( Year % 100 == 0))&&( Year % 400 == 0)))
{
cout<<"The Year "<<Year<<" is a leap year!!"<<endl;
} // HERE
else
{ // HERE
cout<<Year<<" is not a leap year."<<endl;
}