Ok, I know this is my second post in a week or so...but this is killing me. I am trying to write a program to calculate the 3 sides of a triangle using the distance formula and the area of the triangle using Heron's formula. Here is my code so far...
CODE
#include <stdio.h>
#include <math.h>
main ()
{
printf("\n\nThis program is the work of Ben Hogan , I.D. #211");
double a , b , c;
a = sqrt(3.0 - 1.5)**2 + (0.25 - 2.5)**2;
b = sqrt(3.0 - 1.0)**2 + (0.25 - 1.0)**2;
c = sqrt(1.5 - 1.0)**2 + (2.5 - 1.0)**2;
printf("\nThe value of side a is : %g" , a);
printf("\nThe value of side b is : %g" , b);
printf("\nThe value of side c is : %g" , c);
double per , x , area;
per = a + b + c;
x = .5 * (a + b + c);
area = sqrt(x * (x - a) * (x - b) * (x - c);
printf("\nThe perimeter of the triangle is: %g" , per);
printf("\nThe area of the triangle is: %g" , area);
system("pause");
}
Using Microsoft Visual studio , I receive 15 error messages!!! I have no idea what I have done wrong, thank you all so much. I have the error messages if anyone would like to see them