Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
which day of the week
#4
I can squash that code into 2 lines:

Code: (Select All)
Rem determine day of week.
Print "Enter Month,Day,Year";: Input m%, d%, y%
If m% < 3 Then m% = m% + 12: y% = y% - 1
W% = ((13 * m% + 3) \ 5 + d% + y% + y% \ 4 - y% \ 100 + y% \ 400 + 1) Mod 7
Print "Weekday is on: ";
If W% = 0 Then Print "Sunday"
If W% = 1 Then Print "Monday"
If W% = 2 Then Print "Tuesday"
If W% = 3 Then Print "Wednesday"
If W% = 4 Then Print "Thursday"
If W% = 5 Then Print "Friday"
If W% = 6 Then Print "Saturday"
End
Reply


Messages In This Thread
which day of the week - by macalwen - 12-30-2024, 01:17 PM
RE: which day of the week - by SpriggsySpriggs - 12-30-2024, 03:12 PM
RE: which day of the week - by bplus - 12-30-2024, 03:16 PM
RE: which day of the week - by eoredson - 01-02-2025, 02:15 AM
RE: which day of the week - by Pete - 01-02-2025, 03:16 AM
RE: which day of the week - by bplus - 01-02-2025, 05:45 AM
RE: which day of the week - by bplus - 01-02-2025, 05:55 AM
RE: which day of the week - by SMcNeill - 01-02-2025, 06:18 AM
RE: which day of the week - by eoredson - 01-02-2025, 06:32 AM
RE: which day of the week - by bplus - 01-02-2025, 06:42 AM
RE: which day of the week - by eoredson - 01-02-2025, 07:14 AM
RE: which day of the week - by bplus - 01-02-2025, 07:25 AM
RE: which day of the week - by bplus - 01-02-2025, 07:33 AM
RE: which day of the week - by eoredson - 01-02-2025, 07:49 AM
RE: which day of the week - by eoredson - 01-02-2025, 08:13 AM
RE: which day of the week - by bplus - 01-02-2025, 08:18 AM
RE: which day of the week - by eoredson - 01-02-2025, 08:22 AM
RE: which day of the week - by Pete - 01-02-2025, 08:34 AM
RE: which day of the week - by bplus - 01-02-2025, 08:34 AM
RE: which day of the week - by SMcNeill - 01-02-2025, 10:44 AM
RE: which day of the week - by SpriggsySpriggs - 01-02-2025, 02:14 PM
RE: which day of the week - by SierraKen - 01-02-2025, 05:58 PM
RE: which day of the week - by bplus - 01-02-2025, 10:14 PM
RE: which day of the week - by Pete - 01-02-2025, 06:57 PM
RE: which day of the week - by macalwen - 01-05-2025, 11:51 AM
RE: which day of the week - by Pete - 01-06-2025, 01:48 AM



Users browsing this thread: 16 Guest(s)