need help related to function program

whenever i try to compile this program error comes that you can not use fibonacci?number as a function. please solve this error.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <cmath>
using namespace 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);
  }
  else if (n==1)
  {
  	return (1);
  }	
  else if (n > 1)
  {
  	temp = ((n-1) + (n-2));
  }
  return (temp);
}
closed account (D80DSL3A)
Line 9. You've declared a variable by the same name as the function, shadowing the function name. Make the names different.
please correct me while providing code example that would be a blessing
closed account (D80DSL3A)
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.
Topic archived. No new replies allowed.