Jump to content

Day of the week: Difference between revisions

add gw basic
(add gw basic)
Line 733:
25-12-2112
25-12-2118</pre>
 
==={{header|GW-BASIC}}===
<lang gwbasic>10 M = 12
20 D = 25
30 FOR Y = 2007 TO 2122
40 GOSUB 100
50 IF Z = 0 THEN PRINT Y
60 NEXT Y
70 END
100 REM CALCULATE DAY OF WEEK Z GIVEN
110 REM YEAR Y, MONTH M AND DAY D
120 REM SUNDAY = 0, SATURDAY = 6
130 IF M < 3 THEN Y = Y - 1 : M = M + 12
140 Z = Y + INT(Y/4) - INT(Y/100) + INT(Y/400)
150 Z = Z + D + INT((153*M + 8)/5)
160 Z = Z MOD 7
170 RETURN</lang>
 
==={{header|IS-BASIC}}===
781

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.