function problem

the program i have written should return "m" when i input 2 but it doesnot , plz show me the error

#include<iostream>
using namespace std;
void area (int a )
{
if (a==2)
{
cout<<"mn \n";
}

}
int main()
{ int x;
cout<<"enter a number.\n";
cin>>x;
void area (int x);
system("pause");
return 0;
}
Last edited on
void area (int x);
The above is a function declaration, not a call.
A function call looks like this:
area(x);
thanks loads it worked
Topic archived. No new replies allowed.