#include <iostream>
using namespace std;
int doublenumber(int x)
{
return 2*x;
}
int main()
{
int a;
cout << "Enter the number that you want to double it : " << endl;
cin>>a;
int d = doublenumber(a);
cout << "Double : " << d << endl;
return 0;
}
There are some problem with your code. Your declaration and definition of function dies not match. So remove declaration as no necessity of it.
You are declaring local x variable inside function which will shadow your function arguments.