1
0
forked from 131/lab3_test

1 Commits
aux ... aux

Author SHA1 Message Date
KIX
f54605bb36 aye 2025-11-22 05:02:00 -05:00

28
fibonacci.c Normal file
View File

@@ -0,0 +1,28 @@
#include <stdio.h>
int main() {
int i, n;
int t1 = 0, t2 = 1;
int next = t1 + t2;
printf("kol-vo: ");
scanf("%d", &n);
printf("Fibonaci: %d, %d, ", t1, t2);
for (i = 3; i <= n; ++i) {
printf("%d, ", next);
t1 = t2;
t2 = next;
next = t1 + t2;
}
return 0;
}