Jun 8, 2017 at 7:20pm
Hi guyz. I need class which defines is it or not Leap year. The main idea is that year must choose user. So if u have some ideas please help me
Jun 8, 2017 at 8:10pm
Here's a function which returns true if its argument represents a leap year.
1 2 3
|
constexpr bool is_leap_year(unsigned const year) noexcept {
return (year % 4) || (!(year % 100) && (year % 400);
}
| |
Last edited on Jun 8, 2017 at 8:10pm