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 meant by entry controlled loop? What all C++ loops are exit controlled?

1015


What happens when you make call 'delete this;'?

1027


What is scope in c++ with example?

1045


How do you compile the source code with your compiler?

1002


What is set in c++?

1068


Is c++ a high level language?

945


Differentiate between a template class and class template in c++?

1050


If you don’t declare a return value, what type of return value is assumed?

886


What is difference between c++ 11 and c++ 14?

1012


Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.

1002


What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random

1072


How do I use turbo c++?

939


What is endl?

1077


What is c++ w3school?

1056


What is pointer in c++ with example?

1009