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

Is it possible to provide default values while overloading a binary operator?

1266


What is the full name of logo?

1118


What is the best c++ compiler for windows 10?

1037


Can I learn c++ without c?

1142


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

1171


Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers

1047


Why is c++ awesome?

1028


How does com provide language transparency?

1005


What is the difference between prefix and postfix versions of operator++()?

1079


Differentiate between an external iterator and an internal iterator?

994


What is c++ virtual inheritance?

1131


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

1122


How delete [] is different from delete?

1007


How we can differentiate between a pre and post increment operators during overloading?

1100


What happens if a pointer is deleted twice?

1268