diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/fizzbuzz.c | 14 | ||||
| -rw-r--r-- | examples/hello.c | 5 |
2 files changed, 19 insertions, 0 deletions
diff --git a/examples/fizzbuzz.c b/examples/fizzbuzz.c new file mode 100644 index 0000000..c24ce89 --- /dev/null +++ b/examples/fizzbuzz.c @@ -0,0 +1,14 @@ +int printf(const char*, ...); + +int main() { + for (int i = 1; i <= 100; i++) { + if (i % 15 == 0) + printf("FizzBuzz\n"); + else if (i % 3 == 0) + printf("Fizz\n"); + else if (i % 5 == 0) + printf("Buzz\n"); + else + printf("%d\n", i); + } +} diff --git a/examples/hello.c b/examples/hello.c new file mode 100644 index 0000000..5dce624 --- /dev/null +++ b/examples/hello.c @@ -0,0 +1,5 @@ +int printf(const char*, ...); + +int main() { + printf("Hello, World!\n"); +} |
