answersLogoWhite

0

Example of Fibonacci in c plus plus?

Updated: 10/24/2022
User Avatar

Wiki User

10y ago

Best Answer

#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);

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Example of Fibonacci in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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.


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


Example of binaray operator in c plus plus?

+ is an example, one of many, of a binary operator in C or C++ a = b + c; // for usage example


What are the Example Output of Calculator Program in C plus plus?

example output of c++ calculator


Example of flowchart of while loop in c plus plus?

kk


Is c plus plus an unstructured programming language?

No, BASIC is, for example.


Which operator cannot be overloaded c plus plus?

comma (,) is an example


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.....


What were Fibonacci's surnames?

The renowned Middle Ages mathematician's REAL NAME was Leonardo Pisano Bigollo (c. 1170 - c. 1250), but he was known by many names, such as Leonardo of Pisa, Leonardo Pisano, Leonardo Bonacci, Leonardo Fibonacci, and just plain Fibonacci.


What type of math did Leonardo Fibonacci study?

C alculus


Array implementation of priority queue example program in c plus plus?

yes