Professional Documents
Culture Documents
Area
Area
h>
/*Conditions*/
if (a<=0) printf("You entered an invalid value for length of A.\n"); if (b<=0) printf("You entered an invalid value for length of B. \n"); if (c<=0) printf("You entered an invalid value for length of C. \n");
if (c<(a+b)) printf("Given that A+B is more than C, area of Triangle cannot be computed. \n"); if (b<(a+c)) printf("Given that A+C is more than B, area of Triangle cannot be computed. \n"); if (a<(b+c)) printf("Given that B+C is more than A, area of Triangle cannot be computed. \n"); else s=(a+b+c)/2 ; d=s*(s-a)*(s-b)*(s-c) ; area=sqrt(d); printf("The area of the triangle with given values is %lf .", area);
return(0);