Answer to Question #105750 in C++ for Aaron Daniel

Question #105750
Write a c++ program to calculate area of a circle using hero's formula
1
Expert's answer
2020-03-17T10:13:05-0400

If need to calculate the area of circle the function looks 

double Hero1(double r)

{

  const double PI=3.141592653589323846;

  return PI*r*r;

}

If need to calculate the area of triangle using formula heron’s the function looks 

double Hero2(double a, double b, double c)

{

  double s=(a+b+c)/2;

  return sqrt(s*(s-a)*(s-b)*(s-c));

}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS