answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

main()

{

int a=0,b=1,c,i,n;

clrscr();

printf("enter the limit of series\n");

scanf("%d",&n);

if(n==0)

printf("%d\n",a);

else

printf("%d\n%d\n",a,b);

for(i=2;i<=n;i++)

{

c=a+b;

printf("%d\n",c);

a=b;

b=c;

}

getch();

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

#include

void main()

{

int i,f1=0,f2=1,f,n,sum=0;

printf("enter the range dou you want");

scanf("%d",&n); //it identifieses the range number do you want

printf("d",f1,f2);// first two fibanacci numbers

for(i=1;f<=n;i++) //to generate Fibonacci numbers

{

f1=f2;

f2=f;

f=f1+f2;

s=s+f;

printf("%d",f);

} //end for loop

printf("%d",sum);

}end of main

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

#include<iostream>

using namespace std; int main()

{

cout << "Fibonacci sequence up to 100...

int f1 = 0;

int f2 = 1;

cout << f1 << endl;

while (f2<100)

{

cout << f2 << endl;

int next = f1 + f2;

f1 = f2;

f2 = next;

}

}

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

#include<iostream>

int main()

{

int x=0, y=1, sum=x+y;

std::cout<<x<<" ";

std::cout<<y<<" ";

while( y<1000000 )

{

std::cout<<(y+=x)<<" ";

x=y-x;

sum+=y;

}

std::cout<<std::endl;

std::cout<<"Sum = "<<sum<<std::endl;

return(0);

}

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

#include<iostream>

int main()

{

int x=0, y=1;

std::cout<<x<<" ";

std::cout<<y<<" ";

for( ;y<1000000; )

{

std::cout<<(y+=x)<<" ";

x=y-x;

}

std::cout<<std::endl;

return(0);

}

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

#include<iostream>

int main()

{

int x=0, y=1;

std::cout<<x<<" ";

std::cout<<y<<" ";

for( ;y<1000000; )

{

std::cout<<(y+=x)<<" ";

x=y-x;

}

std::cout<<std::endl;

return(0);

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

This question has been asked many times and answered many times please refer to previous answers. Also any future questions you may have have probably been asked and answered by previous students doing the same course as you.

Actually doing the work your self rather than looking for the easy way will benefit you the most because you will learn something. Using someone else work is deceitful and will only cause you to be a failure as a person and in your academic endeavors.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

#include<iostream>

int main()

{

int x=0, y=1;

std::cout<<x<<" ";

std::cout<<y<<" ";

while( y<1000000 )

{

std::cout<<(y+=x)<<" ";

x=y-x;

}

std::cout<<std::endl;

return(0);

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C plus plus program to generate Fibonacci series?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Program to generate Fibonacci series using storage class in c plus plus?

i dn't know. haha


Create a c plus plus program to generate Fibonacci series?

#include #include void main() { clrscr() int a=0,b=1,c,i,n; coutn cout


Can you have the program in C plus plus for recursive function generating a series of terms?

Yes, this can be done. For example for Fibonacci series. You will find plenty of examples if you google for the types of series you need to be generated.


What is the name of the series 1 plus 1 plus 2 plus 3 plus 5 plus 8 plus 13 plus 21 plus 34 plus .................................?

That's the beginning of the Fibonacci series.


What is the name of the series 1 plus 1 plus 2 plus 3 plus 5 plus 8 plus 13 plus 21 plus 34 plus .........?

It's Fibonacci's


A c plus plus program to find Fibonacci series?

#include&lt;iostream&gt; int main() { int x=0, y=1; std::cout&lt;&lt;x&lt;&lt;" "; std::cout&lt;&lt;y&lt;&lt;" "; while( y&lt;1000000 ) { std::cout&lt;&lt;(y+=x)&lt;&lt;" "; x=y-x; } std::cout&lt;&lt;std::endl; return(0); }


How do you write a c plus plus recursion program to find fibonacci series?

#include&lt;iostream&gt; unsigned fib (unsigned term, unsigned a=0, unsigned b=1) { if (term&lt;1) return a; return fib (--term, a+b, a); } int main() { std::cout &lt;&lt; "Fibonacci (1000th term): " &lt;&lt; fib (1000) &lt;&lt; std::endl; }


What are the roots X2 plus x-1 equals 0?

The roots are -1/2 of [ 1 plus or minus sqrt(5) ] . When rounded: 0.61803 and -1.61803. Their absolute values are the limits of the Fibonacci series, or the so-called 'Golden Ratio'.


Would you Write c plus plus program using array for Fibonacci number?

You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....


Write a c plus plus program to find the sum of series S equals 1 plus x2 plus x3 plus x3. plus xn?

(xn+2-1)/(x2-1)


How do you write C plus plus program to generate sum of the series up to n number?

pseudocode: int itotal = 0; int inum = 0; //* Use console routine to prompt and get the value of inum which would be //* the number to which the sum needs to be evaluated for (int i = 1; i &lt; inum + 1; i++) { itotal = itotal + i; } //* Use console routine to display the value of itotal


Which program produces the obj file assembly or C plus plus?

A compiler produces object code, which is an obj file.