Files
chinook/examples/testing/fibonacci.cpp
T
2026-06-26 20:51:42 +00:00

12 lines
213 B
C++

extern "C" int fibonacci(int nth) {
int next;
int temp1 = 0;
int temp2 = 1;
for (int index = 1; index <= nth; index++) {
next = temp1 + temp2;
temp1 = temp2;
temp2 = next;
}
return nth;
}