Skip to content

Instantly share code, notes, and snippets.

@matiskay
Created November 11, 2015 20:08
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 matiskay/0a4866bc12ee6f40e52c to your computer and use it in GitHub Desktop.
Save matiskay/0a4866bc12ee6f40e52c to your computer and use it in GitHub Desktop.
CracklePop
#include <stdio.h>
#define NUMBER_LIMIT 1000
int main() {
int number;
for (number = 1; number <= NUMBER_LIMIT; number++) {
if (number % 3 == 0 && number % 5 == 0) {
printf("%s\n", "CracklePop");
} else if (number % 3 == 0) {
printf("%s\n", "Crackle");
} else if (number % 5 == 0) {
printf("%s\n", "Pop");
} else {
printf("%d\n", number);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment