Practice Learning Problems for C89
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
305B

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(void){
  4. int i = 1;
  5. int max = 2048;
  6. for (i=1;i<=max;i++){
  7. if (i%3 == 0){
  8. if (i%5 == 0){
  9. printf("Fizzbuzz\n");
  10. }else{
  11. printf("Fizz\n");
  12. }
  13. }else{
  14. if (i%5 == 0){
  15. printf("Buzz\n");
  16. }else{
  17. printf("%d\n", i);
  18. }
  19. }
  20. }
  21. return EXIT_SUCCESS;
  22. }