Write your function leap_year so that it returns a bool value.
Inside the function, do the first test. If it fails, return false.
Do the second test. If it fails, return false.
Do the final test. If it fails, return false.
Otherwise, return true.
In your main function, change the code to:
if (leap_year(year))
{
cout << year << " is a leap year.";
}
else
{
cout << year << "Is not a leap year."
}