Skip to content

Instantly share code, notes, and snippets.

@tuggan
Created November 30, 2014 13:08
Show Gist options
  • Save tuggan/aaa6187a52ecb99fd48d to your computer and use it in GitHub Desktop.
Save tuggan/aaa6187a52ecb99fd48d to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int i, d, m;
if (argc != 2)
m = 100;
else
m = atoi(argv[1]);
for(i = 0; i <= m; i++) {
d = 0;
if(i % 3 == 0) {
d = 1;
printf("Fizz");
}
if(i % 5 == 0) {
d = 1;
printf("Buzz");
}
if(!d)
printf("%d", i);
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment