less_retarded_wiki/fizzbuzz.md
2022-09-28 21:42:32 +02:00

328 B

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;
}