Apple Interview Question: Write a fibonacci series... | Glassdoor

Interview Question

Software Engineer Interview Cupertino, CA

Write a fibonacci series

Answer

Interview Answer

3 Answers

1

112358132134...

chriseast on Feb 2, 2011
4

#include
int main(){
    int a = 0, b = 1;
    printf("%d\n%d\n", a, b);
    while (b<1000){
        printf("%d\n", a+b);
        b=a+b;
        a=b-a;
    }
    return 0;
}

Anonymous on Apr 5, 2011

This post has been removed.
Please see our Community Guidelines or Terms of Service for more information.

Add Answers or Comments

To comment on this, Sign In or Sign Up.