Write the program for fibonacci in c++?
Answer Posted / psrthipan j
#include<iostream.h>
int main()
{
int x,y;
x=y=1;
while(x<20)
{
cout<<y<<end 1;
x=x+y;
y=x-y;
}
return 0;
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What are c++ variables?
Explain the use of virtual destructor?
how can i access a direct (absolute, not the offset) memory
address?
here is what i tried:
wrote a program that ask's for an address from the user,
creates a FAR pointer to that adress and shows it. then the
user can increment/decrement the value in that address by
pressing p(inc+) and m(dec-).
NOW, i compiled that program and opened it twice (in 2
different windows) and gave twice the same address to it.
now look what happen - if i change the value in
one "window" of the program, it DOES NOT change in the
other! even if they point to the same address in the memory!
here is the code snippet:
//------------------------------------------------------
#include Is c++ proprietary? How do you differentiate between overloading the prefix and postfix increments? Is c# written in c++? How can we access protected and private members of a class? What is the latest c++ version? Where the memory to the static variables is allocated? Define friend function. What is the use of "new" operator? What are the differences between the function prototype and the function defi-nition? Why do we need c++? What is namespace & why it is used in c++? What is c++ stringstream?