DAY OF WEEK

  Description    : After entry of date compute day of week.
  Inputs         : Day, Month and Year
  Outputs        : Sunday, Monday,.....

\START81\
\NAME=CALENDAR\
\FILE=TI81_1.PRG\
Disp "DAY"
Input D
Disp "MONTH"
Input M
Disp "Year"
Input R
Int
(5R/4)-Int (R/100)+Int (R/400)+Int ((365(M-1)/12)-Int ((13-M)/6)+2(Int ((12-M)/10))+D-1\->\A
If R/100 <> Int(r/100)
Goto 1
If R/400 <> Int(R/400)
Goto 2
Lbl 1
A-Int ((12-M)/10)\->\A
Lbl 2
A-7 Int (A/7)\->\A
If A=0
Disp "SUNDAY"
If A=1
Disp "MONDAY"
If A=2
Disp "TUESDAY"
If A=3
Disp "WENDESDAY"
If A=4
Disp "THURSDAY"
If A=5
Disp "FRIDAY"
If A=6
Disp "SATURDAY"
End
\STOP\

  303 bytes length, uses D,M,R,A variables.