Uploaded FizzBuzz Implementation with Ternary
had to use the printf statements inside because char* and int can't be displayed with same %-label thing
This commit is contained in:
parent
e27c68c1bf
commit
4ed821f1ae
7
FizzBuzzTernary.c
Normal file
7
FizzBuzzTernary.c
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < 100; i++)
|
||||||
|
i % 3 == 0 && i % 5 == 0 ? printf("FizzBuzz\n") : i % 3 == 0 ? printf("Fizz\n") : i % 5 == 0 ? printf("Buzz\n") : printf("%i\n", i);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user