#include <iostream>
#include <cmath>
usingnamespace std;
int fibonacci_number(int n);
// on given value of any number, computes the value as fibonacci value.
int main()
{
int fibonacci_number, n, answer;
cout << " Enter the number : ";
cin >> n;
answer = fibonacci_number(n);
cout << " The fibonacci value of the given number " <<n << " is" << " " << answer << endl;
return 0;
}
int fibonacci_number(int n)
{
int temp;
if (n==0)
{
return(0);
}
elseif (n==1)
{
return (1);
}
elseif (n > 1)
{
temp = ((n-1) + (n-2));
}
return (temp);
}
Just change the name of either the function or the variable so they are different.
Sorry, I'm not going to just do it for you.
Is my advice confusing? It's hard for me to recall being brand new to programming.