A triangle is said to be an 'Equable Triangle', the area of the triangle is equal to its perimeter . Write a program to enter three sides of a triangle . check and print whether the triangle is equable or not
Answers
Answered by
25
Answer:
Exp"public class Triangle
{
public static void main(String args[])
{
double s1, s2, s3, s4, area;
Scanner s = new Scanner(System.in);
System.out.print(""Enter the first side :"");
s1 = s.nextDouble();
System.out.print(""Enter the second side :"");
s2 = s.nextDouble();
System.out.print(""Enter the third side :"");
s3 = s.nextDouble();
s4 = (s1 + s2 + s3 )/ 2 ;
area = Math.sqrt(s4 * (s4 - s1) * (s4 - s2) * (s4 - s3));
System.out.print(""Area of Triangle is:""+area+"" sq units"");
}
}
Answered by
8
Answer:
see your answer it is correct
Attachments:
Similar questions
Business Studies,
6 months ago
Math,
6 months ago
English,
1 year ago
History,
1 year ago
Economy,
1 year ago