Q. Area of an equilateral triangle can be computed as √3/4 * a2 where a is its side. Write a program to obtain side from user and print the area of equilateral triangle with side a.
Answer :-
import math side = float(input("Enter the side of Triangle :- ")) area = math.sqrt ( 3 ) / 4 * side ** 2 print ("Area of Triangle :-",area)
Output :-
Enter the side of Triangle :- 2
Area of Triangle :- 1.7320508075688772
>>>
Enter the side of Triangle :- 100
Area of Triangle :- 4330.127018922193
>>>
But area √3/4 ki form me nhii aayega aise 3/4 ki form me aayega
ReplyDeletemath.sqrt ( 3 ) will execute before / 4 side **2.
DeleteSo, Try this code in your python.
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )