@chux pointed out that my attempted solution contained several problems.  Since I screwed that up so badly, I figure that I should put my revised solution up for review.#include <stdio.h>#include <time.h>/** * The current year (number of years since 1900) */static int this_year(void) {    time_t now = time(NULL);    struct tm thetime;    localtime_r(&now, &thetime);    return thetime.tm_year;}static struct tm jan1(int yy) {    struct tm t = { 0 };    t.tm_year = yy;    t.tm_mday = 1;    t.tm_isdst = -1;    return t;}int main(void) {    int yy = this_year();    for (struct tm t = jan1(yy); mktime(&t), t.tm_year == yy; t.tm_mday++) {        char buf[80];        if (!strftime(buf, sizeof buf, %m/%d/%Y is a %A, &t)) {            return 1;   // Unexpected failure        }        puts(buf);    }}Concerns include standards compliance, portability, and correctness in all possible time zones.  If possible, a more succinct way to obtain the current year and January 1 of the current year would be appreciated.
Printing the days of the week for every day this year
c;datetime;portability