can't use a defined variable as a function

I have to compute the area of a triangle. This is the code I am using.
I am getting the error: `p' cannot be used as a function. My main is working, and I'm 99% sure that i don't have a semi colon or bracket issue, so im not putting things like namespace std in etc.
i have #include <math> and #include <cmath> at the beginning of my program.

double a, b, c, p, t;
if (menu==2)
{
cout<<"\nEnter the side lengths of the triable";
cin>>a;
cin>>b;
cin>>c;
p=(a+b+c)/2;
t=sqrt((p(p-a)(p-b)(p-c));
cout<<"The area is:\n";
cout<<t;
cout<<"\nDo you want to re-run this utility? (Y/N)\n";
cin>>run_utility;
}
else{}
t=sqrt((p(p-a)(p-b)(p-c));

p() is a function call. The () is being treated as a function call operator. I think what you're intending to do is multiply the results, in that case you have to add * between each parentheses.

And one of the first two opening brackets is useless.
thank you so much.
Topic archived. No new replies allowed.