Created
November 11, 2015 20:08
-
-
Save matiskay/0a4866bc12ee6f40e52c to your computer and use it in GitHub Desktop.
CracklePop
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
#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