Print Fibonacci Series using Array C++ Program


Fibonacci Series Using Array

#include<iostream.h>

int main()

{
int a[10],b[10],sum[10],c;
a[0]=0,b[0]=1;

cout<<" Your fabnocci series is ===="<<endl<<endl;
for(c=0;c<=10;c++)
{
   
sum[c]=a[c]+b[c];   
a[c+1]=b[c];
b[c+1]=sum[c];   
}
for(c=0;c<=10;c++)
{   
cout<<a[c]<<" ";   
   
   
}
cout<<"........"<<endl;
cout<<endl<<endl;
}

                              <<<<<<                                       >>>>>>>

Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Powered by Blogger.

Translate

 
 
.