18 lines
274 B
C
18 lines
274 B
C
|
#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;
|
||
|
}
|