Fibconi
Series Program in C Plus Plus
Fibconi
series program is the another important program in C++. Usually the C++
programs of fibconi series display the fibconi series on the screen.
We
will today perform the same task we will write the code of C++ program which
will print the fibconi series on the screen.
Fibconi
Series
Before
we continue to develop the program for fibconi series. Just know what the
fibconi series exactly is?
Fibconi
Series is a series of numbers in which each member is the sum of its preceding
two members except the first two members of the series which are always 0 and
1.
Fibconi
Series Program in C ++
Code
//sofotset.blogspot.com
#include<iostream>
#include<iomanip>
using
namespace std;
int
main()
{
int
limit=2147483647;
int
next=0;
int
last=1;
while(next<limit/2)
{
cout<<last<<" ";
int
sum=next+last;
next=last;
last=sum;
}
cout<<endl;
return
0;
}
Output of Fibconi
Series Program
The
code above when debugged and tested on the compiler IDE Dev C++ produce the
following output.
Hence
we have successfully print out the fibconi series up to the limit of the
integer value.
Thank
you for reading this page giving us your precious time.
Post a Comment
Feel Free to Comment Us