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

#include "stdafx.h"
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{

int range = 0;
cout<<"Enter the range of numbers\n";
cin>>range;

for(int i = 0;i<range;i++)
{

int outNum[100];
if((i==0)||(i==1))
{
outNum[i] = i;
cout<<outNum[i]<<" ";

}
else
{
outNum[i] = outNum[i-1] + outNum[i-2];
cout<<outNum[i]<<" ";

}
}

return 0;
}

Is This Answer Correct ?    13 Yes 33 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is buffering in c++?

1022


Is java the same as c++?

947


What are the methods of exporting a function from a dll?

1156


What do manipulators do?

970


How do I start a c++ project?

1013


How long does it take to get good at leetcode?

1132


what is oops and list its features in c++?

1003


Does c++ have finally?

976


What does extern mean in a function declaration in c++?

1163


Can a program run without main function?

1100


write a programme to get a character and thier ASCII value

3001


What is a storage class used in c++?

1039


If you want to share several functions or variables in several files maitaining the consistency how would you share it?

935


Using a smart pointer can we iterate through a container?

1036


What will happen if a pointer is deleted twice?

1137