21/10/2015

Large Fibonacci Numbers in C++ | Big Fibonacci Series

Write A Program To Find the Large Fibonacci Numbers in C++. For Print Fibonacci Series We Use Simple Method. As we know the Fibonacci Series is started with Zero (0) and the next Element is One Then we add the previous two elements and print the next element of the Fibonacci Series.

Fibonacci Series start with a Zero and the next element is one then first we print 0 and 1. Now add two previous elements and print the next element as 0+1=1. Repeat that process Until the nth term. Large Fibonacci Numbers in C++ are up to 10 Elements below

Fibonacci Series: 0 ,1 ,1 ,2 ,3 ,5 ,8 ,13 ,21 ,34 .

Large Fibonacci Numbers in C++


#include <iostream>
using namespace std;
int main()
{
	int n, a, b, i;

	cout << "How Many Term You Want To Check :\n";
	cin >> n;

	long long A[n];
	a = 0;
	b = 1;
	cout << "The Large Fibonacci Numbers Are :\n";

	if (n < 2)
	{
		A[0] = a;
		A[1] = b;
		cout << A[0] << ", " << A[i];
	}
	else
		A[0] = a;
	A[1] = b;

	cout << A[0] << ", " << A[1] << ", ";

	for (i = 2; i < n; i++)
	{
		A[i] = A[i - 1] + A[i - 2];;
		cout << A[i] << ", ";
	}

	return 0;

}

Large Fibonacci Numbers Output


Large Fibonacci Numbers Output

Similar to Large Fibonacci Numbers


Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me

5 comments:

  1. nice job dude

    ReplyDelete
  2. sir my suggetion is that include program complexity also

    ReplyDelete
    Replies
    1. Ok Bro Thanks For Visiting Next Time I will Remember Your requirement Thanks For Visiting Once Again

      Delete
  3. how to find when the is out of long long int range? ( in c++)

    ReplyDelete