#include <stdio.h>
#include <time.h>

int main(void) {
    const char *ds[] = {"Domingo", "Segunda", "Terca",
                        "Quarta", "Quinta", "Sexta", "Sabado"};
    struct tm tm = {0};
    tm.tm_mday = 1;
    tm.tm_mon = 0; // Janeiro
    tm.tm_year = 113; // 2013
    tm.tm_isdst = 0;
    mktime(&tm); // normalizar tm
    printf("1 de Janeiro de %d calhou em %s.\n",
          tm.tm_year + 1900, ds[tm.tm_wday]);
    return 0;
}