less_retarded_wiki

main page, file list, single page HTML, source, report, wiki last updated on 05/28/23

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

All content available under CC0 1.0 (public domain). Send comments and corrections to drummyfish at disroot dot org.