Saturday, 31 January 2015

Fibonacci Series in C++ Program

Structure of the Problem Requirements 

 A series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 1, 1, 2, 3, 5, 8, etc.Here is the C++ code which will find the Fibonacci of a Number.

Source Code

using namespace std;
int main ()
cout<<"\t \t \t LEP Tutorials \n\n\n";
int num,sum;
long previous =1,next =0;
cout<<"Enter Number to Find Fibonacci Series : ";
while (next < num/2)
cout<<previous<<" ";
sum = previous + next;
next = previous ;
previous = sum;

Output of the Program

Fibonacci Series in C++ Program

Share it Please

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.


Post a Comment