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

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a=0,b=1,c=0,n;
cout<<"Enter the number: ";
cin>>n;
cout<<a<<" "<<b<<" ";
for(int i=1;i<=n;i++)
{
c=a+b;
a=b;
b=c;
cout<<c<<" ";
}
getch();
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is constructor c++?

1114


What are the new features that iso/ansi c++ has added to original c++ specifications?

1134


What do you mean by early binding?

1066


What are the c++ access specifiers?

1417


Explain the pure virtual functions?

1117


What is the main purpose of overloading operators?

1132


Explain the uses oof nested class?

1136


What is a flag in c++?

1053


List the features of oops in c++?

1044


explain the reference variable in c++?

1058


How do you sort a sort function in c++ to sort in descending order?

987


Can we use clrscr in c++?

1079


Briefly describe a B+ tree. What is bulk loading in it?

1331


What is pointer with example?

1055


Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?

4117