I am having problems generating the Fibonacci sequence. I would like to start at 30.
Here is my program:
#include <iostream>
#include <conio>
using namespace std;
int main()
{
int Fibonacci, n;
cout <<"Here is the Fibonacci number sequence until 30 .";
if ( n==1 || n==2 )
return( 1 );
else cout << Fibonacci(n-1) + Fibonacci(n-2);
getch();
return 0;
}
However, I am getting an error message where the statement is in bold. It is telling me that it is a call of nonfunction.
hey its easy to generate a fib series, it just adds the prev 2 nos and then get the third one.
so u cud have for loop to generate it as follows
for(j=0;j<30;j++)
{temp=temp+temp+1)
}
//this generates the fib series till 30
for(i=temp;i<n;i++)
{
i=i+i+1;
printf("%d",& num)
}
// this will generate the remaining fib series from 30 onwards until where u want thats by specifying the value of n!
Well,
What's gonin' on here guys..
I thought the rule here is to correct an existing code instead of providing a completly new one.
-Must take care of this...
Thanks
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.