Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char** argv)
  4. {
  5.     int i;
  6.     int mfive, mthree;
  7.  
  8.     i = mthree = mfive = 1;
  9.  
  10.     while (i <= 100) {
  11.         /* output */
  12.         if (mfive == 5 && mthree == 3) {
  13.             printf("FizzBuzz\n");
  14.             mfive = mthree = 0;
  15.         } else if (mfive == 5) {
  16.             printf("Buzz\n");
  17.             mfive = 0;
  18.         } else if (mthree == 3) {
  19.             printf("Fizz\n");
  20.             mthree = 0;
  21.         } else {
  22.             printf("%i\n", i);
  23.         }
  24.  
  25.         /* increment counters */
  26.         i++;
  27.         mthree++;
  28.         mfive++;
  29.     }
  30.  
  31. }