talk-2019-10-OOPSLA19/src/fib7/fib7.c

18 lines
274 B
C
Raw Normal View History

#include <stdio.h>
void fib7() {
int fibo[8];
fibo[0] = 1;
fibo[1] = 1;
for(int pos = 2; pos < 8; ++pos)
fibo[pos] =
fibo[pos - 1]
+ fibo[pos - 2];
printf("%d\n", fibo[7]);
}
int main(void) {
fib7();
return 0;
}