+ 2
Write a menu driven program to calculate the are of equilateral & isosceles triangle
Use the formula of -equilateral triangle= math.sqrt (3)/4.0*math.pow(S,2) and isosceles triangle 1/4.0*b*math.sqrt(4*math.pow(a,2)-math.pow(b,2)
2 Antworten
- 2
You can use a switch case for this program
0
Write a Menu Driven program to find the area of an equilateral triangle, an isosceles triangle
and a scalene triangle as per user’s choice.
(i) Area of Equilateral triangle = √𝟑
𝟒
𝒔
𝟐
(ii) Area of Isosceles triangle =
𝟏
𝟒
∗ 𝒃 ∗ √𝟒𝒂𝟐 − 𝒃
𝟐
(iii) Area of Scalene triangle = √𝒔 ∗ 𝒔(𝒔 − 𝒂) ∗ (𝒔 − 𝒃) ∗ (𝒔 − 𝒄) , where s = (a +b + c)/2