Write the program for fibonacci in c++?

Answer Posted / n.muthukumar

#include

int main()
{
unsigned int i=0,j=0,sum=1,num;
printf("nEnter the limit for the series ");
scanf("%d",&num);

printf("%d",i);
while(sum
{
printf("%d ",sum);
i=j;
j=sum;
sum=i+j;

}



getch();
}

Is This Answer Correct ?    12 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How are virtual functions implemented in c++?

605


How does atoi function work?

628


How do you invoke a base member function from a derived class in which you have not overridden that function?

584


Can I make ios apps with c++?

562


Explain the difference between realloc() and free() in c++?

540






How do I use turbo c++?

552


What is oop in c++?

601


Why do we need constructors in c++?

621


When does the c++ compiler create temporary variables?

575


What is the difference between the indirection operator and the address of oper-ator?

614


Give 10 points of differences between C & C++.

631


Explain how the virtual base class is different from the conventional base classes of the opps.

695


What are smart pointers?

672


What is #include c++?

572


Explain how to initialize a const member data.

601