Skip to content

Instantly share code, notes, and snippets.

@oliverbooth
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save oliverbooth/8868685 to your computer and use it in GitHub Desktop.

Select an option

Save oliverbooth/8868685 to your computer and use it in GitHub Desktop.
Happy Birthday!
#include <stdio.h>
int main(int argc, char *argv[]) {
if(argc == 1)
printf("Whose birthday is it?\n");
else if (argc == 2)
for(int i = 1; i <= 4; i++)
printf("Happy birthday %s %s\n", i % 3 == 0 ? "dear" : "to", i % 3 == 0 ? argv[1] : "you");
else
printf("Too many.\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment