DEV_BUT1/DEV1.1S/TPREC/fibonacci.c
2023-02-08 11:18:16 +01:00

13 lines
202 B
C

#include <stdio.h>
#include <stdlib.h>
int fib(int n) {
if (n > 1) return n + fib(n-1);
else if (n == 1) return 1;
else return 0;
}
int main(void) {
fib(15);
return EXIT_SUCCESS;
}