Thursday, 24 January 2013

fib series 1st 10

//fib series till  10.

#include <iostream>

using namespace std;

int main()
{


    int a,b,c;
    a=0;
    b=1;
    int i;

    cout << a<< "\t" << b <<"\t" << a+b<< "\t";

            for(i=1; i<= 7;i++)
    {c=a+b;

        cout << c << "\t";

        a=b;
        b=c;
}



    cin.get();
    return 0;
}

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Enterprise Project Management