Fibonacci series is an integer in the infinite sequence 1, 1, 2, 3, 5, 8, 13, … of which the first two terms are 1 and 1 and each succeeding term is the sum of the two immediately preceding. By definition, the first two numbers in the Fibonacci sequence are 1 and 1, or 0 and 1, depending on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two. When the program starts, it will ask user to “Enter an integer: “. When user enters a number it will show him the Fibonacci series and limit of series is less then or equal to the number entered by the User. So that it would be easy to find the Fibonacci series.

#include <iostream>
#include <cstdlib>
using namespace std;

int main()
 int num1=0, num2=1, display=0, num;
 cout<<"Enter an integer: "<<endl;
 cout<<"Fibonacci Series: "<< num1<<" "<<num2;
     cout<<" "<<display;
 return 0;


Tagged with: C/C++ languageSource Code

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Related News Feeds

Set your Twitter account name in your settings to use the TwitterBar Section.