homer512

Coding horror solution

May 8th, 2013
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.   for(int i = 1; i < 101; ++i) {
  6.     if(i % 3 == 0 || i % 5 == 0) {
  7.       if(i % 3 == 0)
  8.         printf("Fizz");
  9.       if(i % 5 == 0)
  10.         printf("Buzz");
  11.     }
  12.     else
  13.       printf("%d", i);
  14.     putchar('\n');
  15.   }
  16.   return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment