C Example: Weekday Finder: Zeller's congruence across six dates
Implements Zeller's congruence for any Gregorian date: January and February are folded into months 13 and 14 of the previous year, then the last two year digits and the century are plugged into the formula. Prints weekday names for six dates including 2026-11-28, 2000-01-01 and 2024-02-29.
🖥 Run OnlineGCC 10.2 · C11 standard · click ▶ to run · Copy code
🖨 Reference OutputMatches the online run in a standard C11 environment
2026-11-28 is a Saturday 2000-01-01 is a Saturday 1969-07-20 is a Sunday 2024-02-29 is a Thursday 1900-03-01 is a Thursday 2038-01-19 is a Tuesday
🧩 Keep Learning