Write the program for fibonacci in c++?

Answer Posted / kishor niit ottapalam

#include<iostream>
int main()
{
int x,y;
x=y=1;
while (x<200)
{
cout<<y<<endl;
x=x+y;
y=x-y;
}
return 0;
}

Is This Answer Correct ?    119 Yes 82 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does improper inheritance have a potential to wreck a project?

859


What is copy constructor? Can we make copy constructor private in c++?

796


Is c++ a float?

794


What is abstraction in c++ with example?

773


Explain mutable storage class specifier.

830


Can non-public members of another instance of the class be retrieved by the method of the same class?

814


What is do..while loops structure?

822


Does c++ have string data type?

877


Do we have to use initialization list in spite of the assignment in constructors?

759


Define stacks. Provide an example where they are useful.

770


What is the prototype of printf function?

865


Why c++ is called oop?

847


What is & in c++ function?

786


What does iomanip mean in c++?

858


Write an algorithm that determines whether or not an almost complete binary tree is a heap.

3660