Write a method to generate the Fibonacci series
Anonymous
void print_fib(int length) { int prev_prev = 0, prev = 1, current = 1; while (length--) { printf(" %d", prev_prev); prev_prev = prev; prev = current; current = prev_prev + prev; } printf("\n"); }
Check out your Company Bowl for anonymous work chats.