RosettaCodeData/Task/Fibonacci-sequence/C/fibonacci-sequence-2.c

10 lines
156 B
C
Raw Permalink Normal View History

2013-04-11 11:14:19 -07:00
long long int fibb(int n) {
int fnow = 0, fnext = 1, tempf;
while(--n>0){
tempf = fnow + fnext;
fnow = fnext;
fnext = tempf;
}
2014-04-02 16:56:35 +00:00
return fnext;
2013-04-10 21:29:02 -07:00
}