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

How will you call C functions from C ++ and vice-versa?

1102


What are the five basic elements of a c++ program?

1073


What are the benefits of oop in c++?

1154


What are abstract data types in c++?

952


How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?

948


Can non graphic characters be used and processed in C++?

1157


Why c++ is better than c language?

979


Which software is best for coding?

1013


Do you know what is overriding?

1131


What is the auto keyword good for in c++?

1136


What are the operators in c++?

1076


How many types of modularization are there in c++?

1043


what are function pointers?

1001


What is polymorphism and its type in c++?

1036


What do you mean by enumerated data type?

1016