-
Working out leap years.
Hey i need some help working out wether a year is a leap year or not. Just needs to return a boolean value. What would be placed in my code?
Code:
bool Date::isLeapYear()
{
}
I've tried a few things and certain dates dont return a correct value. I know its something to do with dividing by 100 and 400 but i cant get it right.
Cheers.
-
Search: Key Word(s): leap, year
Thread / Thread Starter Last Post Replies Views Forum
Showing results 1 to 25 of 88
Search took 4.34 seconds. Search: Key Word(s): leap, year
Thread / Thread Starter Last Post Replies Views Forum
-
Yes i have searched but i cant find anything in C++ that is exactly what i require. I only want a simple answer if that isnt too much to ask. It only has to be the formula. I will be calling it later on in the program.
-
whats a leap year? i might be able to help
-
Well you're obviously not looking hard enough
http://cboard.cprogramming.com/showt...ight=leap+year
If you're always going to give up on anything which takes more than 5(seconds,clicks), then you're not cut out for software.