Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void)
- {
- const char* formats[] = { "%d\n", "Fizz\n", "Buzz\n", "FizzBuzz\n" };
- for(int i = 1; i < 101; ++i) {
- const char* f = formats[(i % 3 == 0) + (i % 5 == 0) * 2];
- printf(f, i);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment