Jump to content

Day of the week: Difference between revisions

no edit summary
(→‎{{header|Julia}}: A new entry for Julia)
No edit summary
Line 1,937:
{{out}}
<pre>Christmas falls on Sunday in the years 2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118</pre>
 
=={{header|PARI/GP}}==
<lang parigp>
njd(D) =
{
my (m, y);
 
if (D[2] > 2, y = D[1]; m = D[2]+1, y = D[1]-1; m = D[2]+13);
 
(1461*y)\4 + (306001*m)\10000 + D[3] - 694024 + if (100*(100*D[1]+D[2])+D[3] > 15821004, 2 - y\100 + y\400)
}
 
for (y = 2080, 2121, if (njd([y,12,25]) % 7 == 1, print(y)));
</lang>
 
Output:
<pre>
2011
2016
2022
2033
2039
2044
2050
2061
2067
2072
2078
2089
2095
2101
2107
2112
2118
</pre>
 
=={{header|Pascal}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.