Created
October 25, 2014 16:29
-
-
Save REPOmAN2v2/4cfd3b4d31575e736f51 to your computer and use it in GitHub Desktop.
Clever fizzbuzz
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> | |
int main(void) { | |
const char *messages[] = { "%d\n", "Fizz\n", "Buzz\n", "Fizzbuzz\n" }; | |
for (int i = 1; i <= 100; i++) | |
printf(messages[!(i % 3) | (!(i % 5) << 1)], i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment