C++ Programs & Stuffz

Nothing like anything!!!

Please Click on ADS!!

Please Click on the above ads given by GOOGLE , so that I can maintain my blog!!

Tuesday, August 31, 2010

Print the first 10 numbers in tke fibonocci series

//pgm to print the first 10 numbers in tke fibonocci series
#include<iostream.h>
#include<conio.h>
void main()
{
    int i,a,b,c;
    clrscr();
    a=0;
    b=1;
    c=a+b;
    cout<<a<<endl<<b<<endl<<c<<endl;
    for(i=4;i<=10;i++)
    {
        a=b;
        b=c;
        c=a+b;
        cout<<c<<endl;
    }
    getch();
}

0 comments:

Post a Comment

free counters