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 / ria

#include <iostream.h>
#include <conio.h>
void main()
{
clrscr ();
int n,f1,f2,f3,i;
cout<<"/n input the no.of terms";
cin>>n;
f1=-1;
f2=1;
cout<<"/n the fibonacci series is ";
for(i=1,i<=n,i++)
{
f3=f1+f2;
cout<<"/n"<<f3;
f1=f2;
f2=f3;
}
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c++ w3school?

1120


What are the advantages of using pointers in a program?

1151


Does c++ vector allocate memory?

1021


What is binary object model?

1041


Can we define a constructor as virtual in c++?

1148


What does h mean in maths?

1233


Should I learn c or c++ first?

1137


What is enum class in c++?

1266


How can you quickly find the number of elements stored in a static array?

1107


Explain all the C++ concepts using examples.

1216


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

1064


Why would you use pointers in c++?

1161


What is static function? Explain with an example

1090


What is difference between malloc()/free() and new/delete?

1181


Why isn't sizeof for a struct equal to the sum of sizeof of each member?

1007