Write the program for fibonacci in c++?

Answer Posted / bharghavi

#include<iostream.h>
void main()
{
int a=-1;b=1,c;
for(int i=0;i<200;i++)
{
c=a+b;
cout<<c<<"\t";
a=b;
b=c;
}

Is This Answer Correct ?    83 Yes 65 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use using namespace std in c++?

797


Which is better turbo c++ or dev c++?

750


How delete [] is different from delete?

767


What is the syntax for a for loop?

791


What is c++ manipulator?

715


What is the basic structure of c++ program?

780


What does std :: flush do?

862


How would you call C functions from C++ and vice versa?

819


What are literals in C++?

771


What is the difference between containment and delegation?

936


What is object file? How can you access object file?

818


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

3569


What is a pointer how and when is it used?

782


Explain the uses of static class data?

832


Which bit wise operator is suitable for putting on a particular bit in a number?

922