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 function overloading in C++?

1433


What is the difference between strcpy() and strncpy()?

1147


What is the difference between interpreters and compilers?

1197


Is swift faster than c++?

1025


What is the difference between global variables and local variable

1070


What is the use of main function in c++?

978


What do you mean by const correctness?

1093


What is the purpose of the "delete" operator?

1069


What is &x in c++?

1006


What is a class template?

1090


How would perform Pattern Matching in C++?

1242


What are enumerations?

1111


What is the use of object in c++?

1105


What is scope operator in c++?

1086


Explain selection sorting. Also write an example.

1059