I need a little help, I'm still new to the C++ stuff and this is for my class. Any help anyone could give me would be great.
the code I have is as follows:
____________________________________________________________________________
#include <iostream>
using namespace std;
int find_fib(int);
int main(int argc, char* argv[])
{
int n=0, result=0;
cout << "Enter the position in the sequence to find: ";
cin >> n;
result = find_fib( n );
cout << result << " is the " << n << "th Fibonacci sequence number" << endl;
system("pause");
return 0;
}
int find_fib( int n )
{
if(n < 3)
return 1;
else
return( find_fib(n - 2) + find_fib( n - 1 ) );
}