Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write the program for fibonacci in c++?

Answer Posted / joy

#include<iostream.h>
#include<conio.h>
voidmain()
{
clrscr();
int f1=0,f2=1,f3,n,i;
cout<<"Enter the number of terms...";
cin>>n;
cout<<"Fibonacci Series\n";
cout<<f1<<'\n'<<f2<<'\n';
for(i=3;i<=n;i++)
{
f3=f1+f2;
cout<<f3<<'\n';
f1=f2;
f2=f3;
}
getch();
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how an exception handler is defined and invoked in a Program.

1135


Differentiate between realloc() and free().

994


What are the two main components of c++?

1071


What is the difference between cin.read() and cin.getline()?

1026


How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?

1245


Why do we need runtime polymorphism in c++?

980


What is the use of object in c++?

1071


How did c++ start?

1050


What is problem with overriding functions?

1018


What are references in c++? What is a local reference?

991


Define pure virtual function?

946


what you know about c++?

1099


What is recursion?

1975


What are namespaces in c++?

1045


What are the various compound assignment operators in c++?

946