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
English,
7 months ago
Math,
7 months ago
Science,
7 months ago
Math,
1 year ago
India Languages,
1 year ago