Created
September 13, 2018 22:41
-
-
Save imcsk8/2662d710902cf0cad5f062eb9c9a74e6 to your computer and use it in GitHub Desktop.
Programmers day code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Fun code for programmers day | |
* Programmers day is the 256th day of the year | |
* https://en.wikipedia.org/wiki/Day_of_the_Programmer | |
* Iván Chavero <[email protected]> | |
* | |
**/ | |
#include <stdio.h> | |
#include <time.h> | |
void main(void) { | |
time_t t = time(NULL); | |
struct tm *today = localtime(&t); | |
if(today->tm_yday == 255) { | |
printf("Happy Programmers day!!\n"); | |
} | |
else { | |
printf("Happy shitty normal day!!\n"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Fun code for programmers day | |
* Programmers day is the 256th day of the year | |
* https://en.wikipedia.org/wiki/Day_of_the_Programmer | |
* Iván Chavero <[email protected]> | |
* | |
**/ | |
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
daynum := time.Now().YearDay() | |
if daynum == 256 { | |
fmt.Printf("Happy programmer's day!!\n") | |
} else { | |
fmt.Printf("Happy shitty normal day!!\n") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment