Monday, June 17, 2013

Logic Fibonacci series | Fibonacci series in c#.net | Interview Questions Fibonacci sequence

hi below is the logic to get the Fibonacci sequence :

Logic:

 fibo(int n)
        {
            int a = 0;
            int b = 1;

            for (int i = 0; i <= n; i++)
            {
                int temp = a;
                a = b;
                b = temp + b;
                print(a);
            }
        }


C# Implementation :





No comments:

Post a Comment