Created
December 21, 2011 01:00
-
-
Save CarterA/1504046 to your computer and use it in GitHub Desktop.
FizzBuzz
This file contains 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
// | |
// main.c | |
// FizzBuzz | |
// | |
// Created by Carter Allen on 12/20/11. | |
// Copyright (c) 2011 Opt-6 Products, LLC. All rights reserved. | |
// | |
#include <stdio.h> | |
int main () { | |
for (int i = 1; printf(((i % 3 != 0 && i % 5 != 0) ? "%s%s%d%s" : "%s%s%n%s"), ((i % 3 == 0) ? "Fizz" : ""), ((i % 5 == 0) ? "Buzz" : ""), ((i % 3 != 0 && i % 5 != 0) ? i : '\0'), ((i == 100) ? "\n" : ", ")), i <= 100; i++) {} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for (int index = 1; printf(((index % 3 != 0 && index % 5 != 0) ? "%s%s%d%s" : "%s%s%n%s"), ((index % 3 == 0) ? "Fizz" : ""), ((index % 5 == 0) ? "Buzz" : ""), ((index % 3 != 0 && index % 5 != 0) ? index : '\0'), ((index == 100) ? "\n" : ", ")), index <= 100; index++) {}