Anonymous user
Day of the week: Difference between revisions
m
→{{header|Fortran}}: without this, the result is wrong for january and february
m (→{{header|REXX}}: line up comments, DO group statements . -- ~~~~) |
m (→{{header|Fortran}}: without this, the result is wrong for january and february) |
||
Line 636:
FUNCTION Day_of_week(d, m, y)
INTEGER :: Day_of_week, j, k, mm, yy
INTEGER, INTENT(IN) :: d, m, y
IF(mm.le.2) THEN
Day_of_week = MOD(d + (m+1)*26/10 + k + k/4 + j/4 + 5*j, 7)▼
mm=mm+12
yy=yy-1
END IF
j = yy / 100
k = MOD(yy, 100)
END FUNCTION Day_of_week
Line 647 ⟶ 653:
Output
25th of December is a Sunday in 2011 2016 2022 2033 2039 2044 2050 2061 2067 2072 2078 2089 2095 2101 2107 2112 2118
=={{header|GAP}}==
<lang gap>xmas := function(a, b)
|