Day of the week of Christmas and New Year: Difference between revisions

Add C
(Add BCPL)
(Add C)
Line 162:
<pre>12/25/2021 is a Saturday
1/1/2022 is a Saturday</pre>
 
=={{header|C}}==
<lang c>#define _XOPEN_SOURCE
#include <stdio.h>
#include <time.h>
 
int main() {
struct tm t[2];
strptime("2021-12-25", "%F", &t[0]);
strptime("2022-01-01", "%F", &t[1]);
for (int i=0; i<2; i++) {
char buf[32];
strftime(buf, 32, "%F is a %A", &t[i]);
puts(buf);
}
return 0;
}</lang>
{{out}}
<pre>2021-12-25 is a Saturday
2022-01-01 is a Saturday</pre>
 
=={{header|CLU}}==
2,114

edits