This commit is contained in:
Imbus 2023-12-02 07:12:56 +01:00
commit 5069b41630
7 changed files with 69 additions and 0 deletions

7
src/fib.c Normal file
View file

@ -0,0 +1,7 @@
#include "fib.h"
int fib(int n) {
if (n < 2)
return n;
return fib(n - 1) + fib(n - 2);
}

8
src/greet.c Normal file
View file

@ -0,0 +1,8 @@
#include "greet.h"
#include "fib.h"
#include <stdio.h>
void greet(const char *name) {
printf("Hello %s!\n", name);
printf("Fibonacci of 10 is %d\n", fib(10));
}

7
src/main.c Normal file
View file

@ -0,0 +1,7 @@
#include "greet.h"
#include <stdio.h>
int main(void) {
greet("Template");
return 0;
}