write a program to calculate the area of triangle by herons formula using ternary operator
Answers
Answered by
1
s=a+b+c/2;
area=0;
(a+b>c && b+c>a && c+a>b) ? area=sqrt(s*(s-a)*(s-b)*(s-c)) : alert("invalid inputs");
area=0;
(a+b>c && b+c>a && c+a>b) ? area=sqrt(s*(s-a)*(s-b)*(s-c)) : alert("invalid inputs");
Similar questions