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 / tanneru chetan

#include<iostream.h>
#include<process.h>
#include<conio.h>
void main()
{
clrscr();
Start:
int n,a=0,b=1,c=0,i=1;
char w;
cout<<"Enter an positive integer to represnt the
nth term of the fibonnaci series: "<<endl;
cin>>n;
cout<<"The fibonacci series upto the "<<n<<"th term
is:"<<endl;
cout<<0<<endl<<1<<endl;
while(i<=n)
{
c=a+b;
cout<<c<<endl;
a=b;
b=c;
++i;
}
cout<<"Do you want to try again(Y/N):"<<endl;
cin>>w;
if(w=='Y' || w=='y')
{
goto Start;
}
else
{
exit(4);
}
getch();
}

Is This Answer Correct ?    14 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the limitation of cin while taking input for character array?

1988


What is oops in c++?

1000


How does a copy constructor differs from an overloaded assignment operator?

970


What is flush c++?

923


Why is null pointer used?

1116


What are activex and ole?

1009


Where is atoi defined?

1064


What is c++ runtime?

1053


What is iostream in c++ used for?

975


What is the main function c++?

1070


What is tellg () in c++?

1237


What does std mean in c++?

1038


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

1066


What are c++ data types?

1103


What is scope in c++ with example?

1048