Skip to content

Instantly share code, notes, and snippets.

@mrkz
Created July 2, 2013 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrkz/5906429 to your computer and use it in GitHub Desktop.
Save mrkz/5906429 to your computer and use it in GitHub Desktop.
Codethical proof that 42 is the answer to the ultimate question of life, the universe and everything else.
#include <stdlib.h>
#include <limits.h>
#define SECONDS_IN_A_YEAR 31557600LL
void wait(long long int seconds){
while (seconds > 0){
int s = seconds > INT_MAX ? INT_MAX : seconds;
sleep(s);
seconds -= s;
}
}
int deep_thought(){
wait(7500000LL * SECONDS_IN_A_YEAR);
return 42;
}
int main(){
printf("The answer to the ultimate question of life, the universe,"
" and everything else is %d", deep_thought());
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment