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 the rule of three?

960


Define the process of error-handling in case of constructor failure?

977


Why do we use string in c++?

905


What is expression parser in c++

2447


Is c++ pass by reference or value?

1016


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

1014


Explain what you mean by a pointer.

1072


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

1175


What is a vector c++?

1121


Can we define function inside main in c++?

972


Incase of a function declaration, what is extern means?

933


What are the differences between java and c++?

1031


what are the iterator and generic algorithms.

2112


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

1121


What is a set in c++?

928