Coding the fibonacci algorithm.
Anonymous
A fibonacci sequence is a a sequence of numbers in which each number equals the sum of the two preceding numbers. If N is the number then: (0) + (1) + ... (N-2) + (N-1) In C, non-recursively, this looks like: int fib(int n) { int first = 0, second = 1; int tmp; while (n--) { tmp = first+second; first = second; second = tmp; } return first; }
Check out your Company Bowl for anonymous work chats.