I'm trying to get a math program I'm writing to work but I can't get the sqrt function thing to work, can someone tell me what the problem is?
Also when I go to compile I get this error message at the bottom...Code:case 3: float cone(float r, float h, float s); cout<<"What is the radius of the base?"; cin>> r ; cout<<">>>\n\n"; cout<<"What is the height of the cone?"; cin>> h ; cout<<">>>\n\n"; s = sqrt * (r * r + h * h); <--- This is the error line cout<<"The area of the base is: "<< 3.14159265358979323846 * (r * r) <<"\n\n"; cout<<"The surface area of the triangle is: "<< 3.14159265358979323846 * r * (r+s) <<"(requires the slope)\n\n"; cout<<"The height of the sloped side is: "<< s <<"(only valid if radius and height are given)\n\n"; cout<<"The volume of the cone is: "<< 3.14159265358979323846 * r * r * h/3 <<"\n\n"; break;
"invalid operands of types `double ()(double)' and `float' to binary `operator*' "
I'm using float number since I need pi.



LinkBack URL
About LinkBacks


