less_retarded_wiki/fizzbuzz.md

21 lines
328 B
Markdown
Raw Normal View History

2022-09-28 21:42:32 +02:00
# FizzBuzz
TODO
```
#include <stdio.h>
int main(void)
{
for (int i = 1; i <= 100; ++i)
switch ((i % 3 == 0) + (i % 5 == 0) * 2)
{
case 1: printf("Fizz\n"); break;
case 2: printf("Buzz\n"); break;
case 3: printf("FizzBuzz\n"); break;
default: printf("%d\n",i); break;
}
return 0;
}
```