Initial
This commit is contained in:
commit
5069b41630
7 changed files with 69 additions and 0 deletions
7
src/fib.c
Normal file
7
src/fib.c
Normal 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
8
src/greet.c
Normal 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
7
src/main.c
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#include "greet.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
greet("Template");
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue