Hello everyone and thanks for helping each other.

I decided I’ll try to learn the basics of C++ now I’m stuck on the leap year exercise…

I wanted on purpose to write it in a different way then there’s in the hint, so I wanted to add booleans, which I’ll use in the final if statement to decide if the year is a leap one.

But… my code detects years which are common as leap (not the other way though).

Would anyone be so kind and look at my code, to tell me what’s wrong?

```
#include <iostream>
int main() {
int y;
bool divfour;
bool divhunnotF;
bool divFourH;
std::cout << "Enter year ";
std::cin >> y;
if (y%4 == 0) // if I can divide by four set divfour to true
{divfour = true;}
else if (y%100==0 and y%400!=0) // if can evenly divide by 100, but not by 400 assign true
{divhunnotF = true;}
else if (y%400==0) // if can divide by 400 assign true
{divFourH = true;}
if (divfour and !divhunnotF and divFourH) // if divfour is true, divhunnotF isn't and divfourH is, then it's a leap year,right?
{
std::cout << "Leap year\n";
}
else
{
std::cout << "not leap year\n";
}
}
```

Thanks anyone who bothers to check in advance