2 Replies - 544 Views - Last Post: 24 October 2008 - 04:15 AM Rate Topic: -----

#1 malik saud  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-October 08

how to code fibinocci series

Post icon  Posted 23 October 2008 - 11:14 PM

hi
i wana get info about how to write fibinocci series in c++
Is This A Good Question/Topic? 0
  • +

Replies To: how to code fibinocci series

#2 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • member icon

Reputation: 119
  • View blog
  • Posts: 1,565
  • Joined: 25-January 07

Re: how to code fibinocci series

Posted 24 October 2008 - 12:12 AM

There are snippets available on this topic in snippets section. And there are lot of similar topics with solutions are also there. Just have some search on the website and you will get your answer.
Was This Post Helpful? 0
  • +
  • -

#3 master_9002  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 21-October 08

Re: how to code fibinocci series

Posted 24 October 2008 - 04:15 AM

There you go. Thats the basic and most simple form of fibonacci series.
#include<iostream.h>
#include<conio.h>

void main()
{
	int a=0,b=1,c=0,n,i=0;

	clrscr();

	cout<<"Enter the number of terms to be printed :- ";
	cin>>n;

	cout<<a<<" "<<b<<" ";
	i=2;

	while(i<n)
	{
		c=a+b;
		a=b;
		b=c;

		cout<<c<<" ";

		i++;
	}

	getch();
}



Hope u find it useful. Bye :^: :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1