Skip to content

Instantly share code, notes, and snippets.

@wambu-i
Last active December 12, 2018 18:27
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 wambu-i/efc712aa432ec138f59731dc601ebcd6 to your computer and use it in GitHub Desktop.
Save wambu-i/efc712aa432ec138f59731dc601ebcd6 to your computer and use it in GitHub Desktop.
CracklePop implementation in C.
#include <stdio.h>
#define MAX 100
void crackle_pop(){
for (int i = 1; i <= MAX; i++) {
if (i % 15 == 0) {
printf("CracklePop!\n");
}
else if (i % 3 == 0) {
printf("Crackle!\n");
}
else if (i % 5 == 0) {
printf("Pop!\n");
}
else {
printf("%d\n", i);
}
}
}
int main() {
crackle_pop();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment