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 );
           cout << Fibonacci(n-1) + Fibonacci(n-2);
        return 0;

However, I am getting an error message where the cout << Fibonacci(n-1) + Fibonacci(n-2); statement is. It is telling me that it is a call of nonfunction.

What am I doing wrong here?

Did you write that yourself?

I'm sorry...It's not really my program.

Wanna know how I knew that. You have a function but with no actual declaration of it. (no Sh*t sherlock!)

Word of advice. Don't try cheating. Try it yourself from the beginning. You'll get a lot more out of it.

okay, okay, don't get hostile. I'll try it myself and come back. I really do apologize though, for trying to take the easy way out.

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
//this generates the fib series till 30
printf("%d",& num)
// this will generate the remaining fib series from 30 onwards until where u want thats by specifying the value of n!

So, how do I get the user to specify the value of N??

this way:

int N;
cout<<"Please input n";

hope u don't mind i used ur code jimmymerchant...

but that's the way it will work with an user input...

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...