Created
March 26, 2021 00:18
-
-
Save Costava/b3e15ec0b80c158a7fd9236623789223 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example compilation: | |
// gcc fizzbuzz.c -std=c99 -Wall -Wextra | |
#include <stdio.h> | |
int main(void) { | |
for (int i = 1; i <= 100; i += 1) { | |
if (i % 3 == 0) { | |
if (i % 5 == 0) { | |
puts("FizzBuzz"); | |
} | |
else { | |
puts("Fizz"); | |
} | |
} | |
else if (i % 5 == 0) { | |
puts("Buzz"); | |
} | |
else { | |
printf("%d\n", i); | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment