C89/Fizzbuzz/FizzBuzz.c
2019-03-10 11:44:45 +13:00

23 lines
305 B
C

#include <stdio.h>
#include <stdlib.h>
int main(void){
int i = 1;
int max = 2048;
for (i=1;i<=max;i++){
if (i%3 == 0){
if (i%5 == 0){
printf("Fizzbuzz\n");
}else{
printf("Fizz\n");
}
}else{
if (i%5 == 0){
printf("Buzz\n");
}else{
printf("%d\n", i);
}
}
}
return EXIT_SUCCESS;
}