Find the last Sunday of each month: Difference between revisions
Content added Content deleted
(New post in addition to existing posts which were retained. This post uses C++20 syntax and doed not require external libraries, unlike the existing posts.) |
m (Adjusting formatting.) |
||
Line 1,278: | Line 1,278: | ||
int main() { |
int main() { |
||
std::cout << "The dates of the last Sunday in each month of 2023:" |
std::cout << "The dates of the last Sunday in each month of 2023:" << std::endl; |
||
for ( unsigned int m = 1; m <= 12; ++m ) { |
for ( unsigned int m = 1; m <= 12; ++m ) { |
||
Line 1,294: | Line 1,294: | ||
} |
} |
||
} |
} |
||
</syntaxhighlight |
</syntaxhighlight> |
||
{{ out }} |
{{ out }} |
||
<pre> |
<pre> |
||
The dates of the last Sunday in each month of 2023: |
The dates of the last Sunday in each month of 2023: |
||
2023-01-29 |
2023-01-29 |
||
2023-02-26 |
2023-02-26 |